import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int candleCnt = in.nextInt(); int count = 0, max = 0; for(int i = 0; i < candleCnt; i++){ int currentCandle = in.nextInt(); if(currentCandle > max){ max = currentCandle; count = 1; }else if(currentCandle == max){ count++; } } System.out.println(count); } }