# Enter your code here. Read input from STDIN. Print output to STDOUT height = raw_input() candles = raw_input().split(' ') sorted_candles = sorted (candles, key=int, reverse=True) first_highest_candle = sorted_candles[0] result = 0 for candle in sorted_candles: if candle == first_highest_candle: result = result + 1 else: break print result