# Enter your code here. Read input from STDIN. Print output to STDOUT import sys from heapq import * def readInt(): return int(input()) def readNInt(): return map(int, sys.stdin.readline().split()) def readList(): return list(map(int, sys.stdin.readline().split())) def candle(): n = readInt() candleList = readList() M = 0 count = 0 for i in range(n): if candleList[i] > M: M = candleList[i] count = 1 elif candleList[i] == M: count += 1 print count candle()