#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;
    scanf("%d",&n);
    int max ;
    scanf("%d",&max);
    int count = 1;
    int height;
    for(int i=1;i<n;i++){
        scanf("%d",&height);
        if(height > max)
            {
            max = height;
            count = 1;
        }
        else if(height == max)
            count++;
        
    }
    printf("%d\n",count);
    return 0;
}