def blow_candles(height_of_candles): max_size = 0 num_of_candles = 0 for candle in height_of_candles: if candle > max_size: max_size = candle num_of_candles = 1 elif(candle == max_size): num_of_candles+=1 return num_of_candles candles = int(input()) #print(candles) height_of_candles = list(map(int,input().split())) #print(height_of_candles) print(blow_candles(height_of_candles))