from collections import Counter n = int(input()) i = input().split(" ") i = [int(x) for x in i] x = max(i) c = Counter(i) print(c[x])