N = input() arr = list(map(int,input().split())) max_ = max(arr) L = [i for i in arr if i == max_] print(len(L))