#!/bin/python import sys n = int(raw_input().strip()) height = map(int,raw_input().strip().split(' ')) max_height = max(height) amount_of_candles = height.count(max_height) print amount_of_candles