#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;


int main() {
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */   
    int n;
    cin>>n;
    int maxheight=0;
    int count=0;
    for(int i=0;i<n;i++)
        {
        int cheight;
        cin>>cheight;
        if(cheight>maxheight)
            {
            count=0;
            maxheight=cheight;
        }else if(cheight==maxheight)
            count++;
    }
    cout<<++count;
    return 0;
}