Scanner sc = new Scanner(System.in)
int n = sc.nextInt()

def maxs = []
int max = 0
int height
for(int i=0;i<n;i++){
    height = sc.nextInt()
    if(height > max){
        max = height
        maxs = [max]
    } else if(height == max){
        maxs << height
    }
}

println maxs.size()