n = int(input()) s = input().split() l = [] for i in s: l.append(int(i)) soma = 0 maior = max(l) for i in l: if i == maior: soma += 1 print(soma)