Scanner sc = new Scanner(System.in) int n = sc.nextInt() def maxs = [] int max = 0 int height for(int i=0;i max){ max = height maxs = [max] } else if(height == max){ maxs << height } } println maxs.size()