#!/bin/python3 import sys n = int(input().strip()) height = [int(height_temp) for height_temp in input().strip().split(' ')] def candle(n,height): num = 0 max_height = max(height) for h in height: if h == max_height: num += 1 return num print(candle(n,height))