import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

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 n = in.nextInt();
        int [] a = new int[n];
        int l = Integer.MIN_VALUE; 
        for(int i = 0; i < n; i++){
            a[i] = in.nextInt();
            if(l < a[i]){
                l = a[i];
            }
        }
        System.out.println(appearances(a,l,0,0));
    }
    public static int appearances(int [] a, int l, int i, int app){
        if(i == a.length)
            return app;
        else if(l == a[i])
            return appearances(a,l,i+1,app+1);
        else
            return appearances(a,l,i+1,app);
    }
}