# Enter your code here. Read input from STDIN. Print output to STDOUT n = int(raw_input().strip()) arr = map(int, raw_input().strip().split()) max_height = None count_max = 0 for x in arr: if not max_height or x > max_height: max_height = x count_max = 1 elif x == max_height: count_max += 1 else: pass print count_max