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