n=int(input()) imx=0 c_height=[int(i) for i in input().split()] imx=max(c_height) print(c_height.count(imx))