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 num = in.nextInt(); int height = 0; int count = 0; for(int i = 0; i < num;i++){ int candle = in.nextInt(); //System.out.println(candle + " " + height + " " + count); if(height == candle){ count++; } if(height < candle){ height = candle; count = 1; } } System.out.println(count); /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ } }