# Enter your code here. Read input from STDIN. Print output to STDOUT N = int(raw_input().strip()) candles = map(int, raw_input().strip().split(' ')) count, mx = 0, 0 for candle in candles: if candle == mx: count += 1 elif candle > mx: count = 1 mx = candle print count