#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 max = 0, count = 0, curr, t;
    cin >> t;
    while(t--)
    {
        scanf("%d", &curr);
        if(curr > max)
        {
            max = curr;
            count = 1;
        }
        else if(curr == max)
            ++count;
            
    }
    
    cout << count;
    return 0;
}