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