n=int(input()) s=[] s[0:]=map(int,input().split()) m=max(s) print(s.count(m))