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 >= 1 && n <= 100000) { int[] height = new int[n]; for (int i = 0; i < n; i++) { height[i] = in.nextInt(); } int results = getNumberOfCandles(height); if(results > 0) { System.out.println(results); } } } private static int getNumberOfCandles(int[] height) { if(height.length > 0) { Arrays.sort(height); int count = 0; int buffer = height[height.length - 1]; for(int i = height.length - 1; i >= 0; i--) { if(isValidValue(height[i])) { if(height[i] == buffer) { count++; buffer = height[i]; } else { break; } } else { continue; } } return count; } else { return 0; } } private static boolean isValidValue(int i) { return i >= 1 && i <= 10000000; } }