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(); int height[] = new int[n]; int maxHeight = 0; //to find the height of tallest candle(s) for(int height_i=0; height_i < n; height_i++){ height[height_i] = in.nextInt(); if (height[height_i] > maxHeight) maxHeight = height[height_i]; } /* Close scanner */ in.close(); /* Find number of candles with maxHeight */ int count = 0; for (int i = 0; i < height.length; i++) { if (height[i] == maxHeight) count++; } /* Print out result */ System.out.println(count); } }