#!/bin/python3

import math
import os
import random
import re
import sys

# Complete the birthdayCakeCandles function below.
def birthdayCakeCandles(ar):
    count=0
    for i in range(len(ar)):
        x= max(ar)       
    print(ar.count(x))


################# ALTERNATE CODE (WORKS IN HACKERRANK EDITOR) #####################
#def birthdayCakeCandles(ar):
#    count=0
#    x= max(ar)
#    for i in range(len(ar)):
#        if ar[i]==x:
#            count+=1
#    return count


if __name__ == '__main__':
    #fptr = open(os.environ['OUTPUT_PATH'], 'w')

    ar_count = int(input())

    ar = list(map(int, input().rstrip().split()))

    result = birthdayCakeCandles(ar)

    #fptr.write(str(result) + '\n')

    #fptr.close()
