# Enter your code here. Read input from STDIN. Print output to STDOUT n = raw_input().strip() c = map(int, raw_input().strip().split(' ')) max = 0 count = 0 for index, el in enumerate(c): if max < el: max = el count = 1 elif max == el: count += 1 print count