#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main() {
        int n,i,max=0,count=0;
    scanf("%d",&n);
    int h[n];
    for(i=0;i<n;i++)
        {
    scanf("%d",&h[i]);
        if(h[i]>max)
            {
                max=h[i];            
        }
        
    }
     for(i=0;i<n;i++)
        {
        if(h[i]==max)
            {
             count++;         
        }
        
    }
    printf("%d",count);
    
    
    
    
    
    /* Enter your code here. Read input from STDIN. Print output to STDOUT */    
    return 0;
}