# Enter your code here. Read input from STDIN. Print output to STDOUT num=raw_input() candle = map(int,raw_input().split()) high = max(candle) count=filter(lambda x:x==high,candle) print len(count)