#!/bin/python import sys n = int(raw_input().strip()) height = map(int,raw_input().strip().split(' ')) max_height = 0 count = 0 for i in height: if i > max_height: max_height = i count = 1 elif i == max_height: count += 1 print(count)