n = input().strip()
arr = [int(arr_temp) for arr_temp in input().strip().split(' ')]
max = -1
count =0

for x in range(0,len(arr)):
    if x==0:
        max=arr[x]
        count+=1
    else:
        if arr[x]>max:
            max=arr[x]
            count= 1
        elif arr[x]==max:
            count+=1


print (count)