# Enter your code here. Read input from STDIN. Print output to STDOUT n=int(raw_input()) h=map(int,raw_input().strip().split(" ")) ct=0 b=max(h) for num in h: if num==b: ct+=1 print ct