# Enter your code here. Read input from STDIN. Print output to STDOUT N = int(raw_input()) candles = map(int, raw_input().split(' ')) print candles.count(max(candles))