# Enter your code here. Read input from STDIN. Print output to STDOUT n = raw_input() str_heights = raw_input() heights = [int(h) for h in str_heights.split()] print heights.count(max(heights))