# Enter your code here. Read input from STDIN. Print output to STDOUT
candles = input()
heights = raw_input().split(" ")
heights = [int(x) for x in heights]
print heights.count(max(heights))