import java.io.*; import java.util.*; 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 in = new Scanner(System.in); long numCandles = in.nextInt(); long height = 0; int count = 0; long maxHeight = 0; long temp = 0; for(long i=0; imaxHeight){ maxHeight = height; count = 0; //System.out.println("Count reset to: " + count); } if(height==maxHeight){ count++; //System.out.println("count increased to: " + count); } } System.out.println(count); } }