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