# code template from sys import stdin def get(): return testcase.next().strip() testcase = stdin # solution starts here N = int(get()) arr = map(int, get().split()) MAX = max(arr) print arr.count(MAX)