N = int(input())

H_list_str = input().split()
H_list_int = list(map(int,H_list_str))

M = max(H_list_int)
H_Count = 0
for i in range(N):
    if H_list_int[i] == M:
        H_Count += 1

print(H_Count)