import sys
n=int(input())
h=list(map(int, input().split()))
x=1
ans=h[0]
for i in range(1,n):
    if h[0]>=h[1] and h[0]>=h[2]:
        x=0
        print(1)
        sys.exit()
    if h[i]>=h[i-1]:
        x=x+1 
print(x)