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 = scanner.nextInt();
        int tallest, counter = 1;
        int[] height = new int[n];
        for (int i = 0; i < height.length; i++) {
            height[i] = scanner.nextInt();
        }
        
        tallest = height[0];
        
        for (int i = 1; i < height.length; i++) {
            if (height[i] > tallest) {
                tallest = height[i];
                counter = 1;
            } else if (height[i] == tallest) {
                counter++;
            }
        }
        System.out.println(counter);
    }
}