# Enter your code here. Read input from STDIN. Print output to STDOUT i=raw_input() j=int(i) list=[int(i) for i in raw_input().split()] highest = max(list) count=0 for j in range(0,j): if(list[j]==highest): count=count+1 print count