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) { Scanner in = new Scanner(System.in); int n = in.nextInt(); if (n <= 100000 && n >= 1) { List height= new ArrayList<>(); for (int height_i = 0; height_i < n; height_i++) { height.add(in.nextInt()) ; if (height.get(height_i) < 1 || height.get(height_i) > 10000000) { System.exit(0); } } int maximo = Collections.max(height); int cantidad = Collections.frequency(height, maximo); System.out.println(cantidad); } } }