N=int(input())
a=input().split()
A=list(map(int,a))
print(A)

tmp=0
count=0
for i in range(N):
  if(i==0):
    tmp=A[0]
  if(tmp<=A[i]):
    #print(A[i])
    tmp=A[i]
  else:
    count+=1

print(count)
