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