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 in = new Scanner(System.in);
        int x =0;
        int max=0;
        int n = in.nextInt();
        int[] h = new int[n];
        for(int i=0;i<n;i++){
            h[i] = in.nextInt();
        }
        for(int i=0;i<n;i++){
            if(h[i]>max){
                x=1;
                max=h[i];
            }else if(h[i]==max)
                x++;  
        }
            System.out.println(x);  
    }
}