#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;


int main() {
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */
    int t,c,max=0;
    cin>>t;
    for(int i=0; i<t; i++){
        int x;
        cin>>x;
        if(x > max){
            max = x;
            c=1;
        } else  if (x == max){
            c++;
        }
    }
    cout<<c;
    return 0;
}