#!/bin/python3 import sys n = int(input().strip()) height = [int(height_temp) for height_temp in input().strip().split(' ')] candleMap = {} for candle in height: if candle in candleMap: candleMap[candle] = candleMap[candle] + 1 else: candleMap[candle] = 1 print(int(candleMap[max(candleMap.keys())]))