#!/bin/python3 import sys n = int(input().strip()) height = [int(height_temp) for height_temp in input().strip().split(' ')] ht ={} maxer = 0 for i in range(0,len(height)): item = str(height[i-1]) if height[i-1] > maxer: maxer = height[i-1] if ht.get(item) is None : ht[item]=1 else: ht[item] = int(ht[item]) + 1 print(ht.get(str(maxer)))