#!/bin/python3 import sys n = int(input().strip()) height = [int(height_temp) for height_temp in input().strip().split(' ')] max = 0 count = 0 for cand in height: if cand > max: max = cand count = 1 elif cand == max: count += 1 print(count)