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


int countMax(vector <int> arr, int max_height)
{
    int cnt = 0;
    for(int i = 0; i < arr.size(); i++)
    {
        if(arr[i] == max_height)
        cnt++;        
    }
    return cnt;
}
int findMax(vector <int> arr)
{
	int max = 0;
	for(int i = 0; i < arr.size(); i++)
    {
        if( max < arr[i] )
			max = arr[i];
    }
    return max;
}

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

	int n;
    cin >> n;

    vector <int> candle(n);
    for(int i = 0; i < n; i++)
    	cin >> candle[i];

    int max_height = findMax(candle);
    int cnt_max = countMax(candle, max_height);
    
    cout << cnt_max;
    return 0;
}