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