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