import java.io.*;
import java.util.*;

public class Solution {

    public static void main(String[] args) {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
        
        Scanner stdIn = new Scanner(System.in);
        
        int numOfCandles = stdIn.nextInt();
        int max = 0;
        int numOfCandlesBlownOut = 0;
        int[] arrCandles = new int[numOfCandles];
        
        for(int i = 0; i < numOfCandles; i++){
            int nextCandle = stdIn.nextInt();
            
            if(nextCandle > max){
                max = nextCandle;
            }
            
            arrCandles[i] = nextCandle; 
        }
        
        for(int i = 0; i < arrCandles.length; i++){
            if(arrCandles[i] == max){
                numOfCandlesBlownOut += 1;
            }
        }
        
        System.out.println(numOfCandlesBlownOut);
        
    }
}