n=int(input()) a=list(map(int,input().split())) m=max(a);count=0; for i in range(n): if(a[i]==m): count=count+1 print(count)