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