def candle(num_of_candles, candles):
    tallest_candle = 0
    count = 0
    if int(num_of_candles) >= 1 and int(num_of_candles) <= 10**5:
        for i in candles:
            if int(i) >= 1 and int(i) <= 10**7:
                if int(i) > tallest_candle:
                    tallest_candle = int(i)
        for i in candles:
            if int(i) >= 1 and int(i) <= 10**7:
                if int(i) == tallest_candle:
                    count += 1
        print(count)
    
num_of_candles = input()
candles = input()
list_of_candles = candles.split()
candle(num_of_candles,list_of_candles)