input() nums = list(map(int,input().strip().split())) m = max(nums) print (len([x for x in range(len(nums)) if nums[x]==m]))