import java.util.Scanner;

public class Solution {

    public static void main(String[] args) {
       
    	Scanner scanInput = null;
    	try
    	{
    		 scanInput = new Scanner(System.in);
        	
        	int numberOfCandles = scanInput.nextInt();
        	
        	scanInput.nextLine();
        	
        	
        	
        	int maxElement = -1;
        	
        	int count = 0;
        	
        	for(int i = 1;  i <= numberOfCandles ; i ++)
        	{
        		int ithCandleHeight = scanInput.nextInt();
        		
        		if(ithCandleHeight > maxElement)
        		{
        			maxElement = ithCandleHeight;
        			count = 1;
        		}else if (ithCandleHeight == maxElement)
        		{
        			count++;
        		}
        	}
        	
        	System.out.println(count);
     
    	}
    	finally
    	{
    		scanInput.close();
    	}
    	   	
    	
    	
    	
    	
    	
    	
    }
}