# Enter your code here. Read input from STDIN. Print output to STDOUT n = int(raw_input()) c = map(int, raw_input().split(' ')) tallest = max(c) count = 0 for ca in c: if ca == tallest: count += 1 print count