# Enter your code here. Read input from STDIN. Print output to STDOUT
n = input()
heights = raw_input()
heights = map(lambda x : int(x), heights.strip().split(" "))

max_height = max(heights)

candles = heights.count(max_height)
print candles