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