n = raw_input()

l = map(int, raw_input().strip().split(' '))
print l.count(max(l))