n = int(input()) cands = list(map(int,input().split(' '))) m = max(cands) print(cands.count(m))