# Enter your code here. Read input from STDIN. Print output to STDOUT num_candles = int(raw_input().strip()) candle_heights = map(int, raw_input().split()) max_height = 0 candle_count = 0 for num in candle_heights: if num > max_height: max_height = num candle_count = 0 if num == max_height: candle_count += 1 print(candle_count)