# Enter your code here. Read input from STDIN. Print output to STDOUT n=int(raw_input().strip()) h=(map(int, raw_input().strip().split(' '))) max=0 count=0 for i in range(n): if h[i]>max: max=h[i] count=1 continue if h[i]==max: count=count+1 print count