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