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