#include <iostream>
using namespace std;

int main() {
	int quantity,force,count = 0,max = 0;
	cin >> quantity;
	while (cin >> force)
	{
		if (force > max)
		{
			max = force;
			count = 1;
		}
		else if (force == max) count++;
	}
	cout << count; 
	return 0;
}