n = int(input())
h = list(map(int, input().split()))
ans = 1
highest = h.index(max(h))
h_c = h.count(max(h))
if h_c >= 1:
    h_c -= 1

for i in range(1, highest+1):
    if h[0] <= h[i] and h[i-1] <= h[i]:
        ans += 1

print(ans+h_c)