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) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner scan = new Scanner(System.in); int numOfCandles = Integer.parseInt(scan.nextLine()); String nextLine = scan.nextLine(); String[] candleStringLine = nextLine.split(" "); int maxHeight = 0; int count = 0; for (String s: candleStringLine){ int current = Integer.parseInt(s); if (current > maxHeight){ maxHeight = current; count = 1; }else if (current == maxHeight){ count++; } } System.out.println(count); } }