#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 count=0,max=0;
    
    for(int i=0;i<n;++i){
        int x;
        cin>>x;
        
        if(x==max)
            count++;
        if(x>max){
            count=1;
            max=x;   
        }   
        
    }
    
    cout<<count<<"\n";
    return 0;
}