N = int(input())
candles = [int(i) for i in input().strip().split()]
print(candles.count(max(candles)))