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