#!/bin/python import sys n = int(raw_input().strip()) height = map(int,raw_input().strip().split(' ')) index = 1 temp = height[0] counter = 1 while index < len(height): if height[index] == temp: counter += 1 if height[index] > temp: temp = height[index] counter = 1 index += 1 print counter