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 n = in.nextInt(); int count = 0; int tall = 0; int height[] = new int[n]; for(int i=0; i < n; i++){ height[i] = in.nextInt(); if(height[i]==tall){ count++; } if(height[i]>tall){ count=1; tall=height[i]; } } System.out.println(count); } }