n = input().strip()
h = [int(i) for i in input().strip().split(' ')]
#print (str(n))
#print (h)
#print (str(max(h)))
print (str(h.count(max(h))))