# Enter your code here. Read input from STDIN. Print output to STDOUT n = map(int, raw_input())[0] i = map(int, raw_input().split(' ')) height = max(i) count = 0 for j in i: if j == height: count += 1 print count