input()
lst = [int(i) for i in input().split()]
m = max(lst)
print(sum(i == m for i in lst))