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. */ try(Scanner in = new Scanner(System.in)) { int numCandles = in.nextInt(); int max = 0; Map heights = new HashMap<>(); for(int i = 0; i < numCandles; i++) { int n = in.nextInt(); Integer count = heights.get(n); if(count == null) { heights.put(n, 1); } else { heights.put(n, count + 1); } max = Math.max(max, n); } System.out.println(heights.get(max)); } } }