import java.io.*;
import java.util.*;

public class Solution {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        
        int n = input.nextInt();
        int[] candlesArray = new int[n];
        for (int i = 0; i < n; i++) {
            candlesArray[i] = input.nextInt();
        }
        
        // find the biggest number
        int max = 1;
        int counter = 0;
        // get and return count of biggest number
        for (int i = 0; i < n; i++) {
            if (candlesArray[i] >= max) {
                max = candlesArray[i];
            }
        }
		
		for (int i = 0; i < n; i++) {
            if (candlesArray[i] >= max) {
                
                counter++;
	       }
        }

        System.out.print(counter);
        
    }
}