#!/bin/python import sys n = int(raw_input().strip()) height = map(int,raw_input().strip().split(' ')) h_max = max(height) count = sum([1 if h == h_max else 0 for h in height]) print count