n = int(input()) t = input().split() max1 = 0 count = 0 #print(t) for i in range(n): x = int(t[i]) #print(x) if(x>max1): max1 = x count = 1 #print('here') elif(x == max1): #print('Here now') count = count + 1 #print(count,max1) print(count)