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 scanner = new Scanner(System.in);
        
        int N = 0;
        
        if(scanner.hasNext()){
            if(scanner.hasNextInt()){
                N = scanner.nextInt();
            }
            else{
                System.out.println("Error");
                System.exit(0);
            }
        }
        
        int[] h = new int[N];
        
        for(int i=0;i<N;i++){
            if(scanner.hasNextInt()){
                h[i] = scanner.nextInt();
            }
        }
        
        int maxHeight = 0;
        int count = 0;
        
        for(int i=0;i<N;i++){
            if(maxHeight < h[i]){
                maxHeight = h[i];
                count = 1;
            }
            else if(maxHeight == h[i]){
                count++;
            }
        }
        
        System.out.println(count);
        
    }
}