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