n = int(input()) a = list(map(int, input().split(" "))) m = max(a) print(sum([1 for _ in a if _ == m]))