#!/bin/python3 import sys n = int(input().strip()) height = [int(height_temp) for height_temp in input().strip().split(' ')] occurences = 0 max_height = None for candle in height: if max_height == None: max_height = candle occurences = 1 elif max_height == candle: occurences += 1 elif max_height < candle: max_height = candle occurences = 1 print(occurences)