#!/bin/python import sys def findMax(height): max = 0 for x in range(len(height)): if(height[x] > max): max = height[x] return max def findTotal(height, maxHeight): cntr = 0 for x in range(len(height)): if(height[x] == maxHeight): cntr = cntr + 1 return cntr n = int(raw_input().strip()) height = map(int,raw_input().strip().split(' ')) maxHeight = findMax(height) totalBlow = findTotal(height, maxHeight) print(totalBlow)