# Enter your code here. Read input from STDIN. Print output to STDOUT n=input() s1=raw_input() m=s1.split() m1=max(m) count=0 for i in m: if m1==i: count=count+1 print count