#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <map>
using namespace std;


int main() {
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */   

	unsigned long n; cin >> n;
	map<unsigned long, unsigned long> mp;

	unsigned long max = 0;

	for(unsigned long i = 0; i < n; i++){
		unsigned long h; cin >> h;
		mp[h]++;
		if(h > max)
			max = h;
	}

	cout << mp[max] << endl;

    return 0;
}