Sensen is learning lists , Find a classic topic : Find most elements in a sequence .
She gave you a simplified version of the question :
Ask you the number of occurrences of the most frequent element in this sequence .
Input multiple lines , One number per line represents each number in the sequence .
notes : Use
try:
except EOFError:
To determine when to end the input
Output one line , Indicates the number of occurrences of the number with the most occurrences .
12
13
14
12
2
list=[]
while(1):
try:
num=int(input())
list.append(num)
except:
break
dict={
}
for key in list:
dict[key]=dict.get(key,0)+1
value=max(dict.values())
print(value)