def birthdayCakeCandles(ar):
    ar.sort()
    max = ar[len(ar) - 1]
    x = 0
    for i in ar:
        if i == max:
            x = x + 1
    print(x)


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

c9011a4b75b0e39da3986e34ca61bcc593afcd7a
<mask token>

def birthdayCakeCandles(ar):
    ar.sort()
    max = ar[len(ar) - 1]
    x = 0
    for i in ar:
        if i == max:
            x = x + 1
    print(x)


<mask token>

def birthdayCakeCandles(ar):
    ar.sort()
    max = ar[len(ar) - 1]
    x = 0
    for i in ar:
        if i == max:
            x = x + 1
    print(x)


<mask token>
birthdayCakeCandles(ar)

def birthdayCakeCandles(ar):
    ar.sort()
    max = ar[len(ar) - 1]
    x = 0
    for i in ar:
        if i == max:
            x = x + 1
    print(x)


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