a = input() b = list(map(int, input().split())) max = 0 counter = 0 for x in range(0, len(b)): if b[x] > max: max = b[x] for x in range(0, len(b)): if b[x] == max: counter += 1 print(counter)