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