n=int(input()) A=list(map(int,input().split())) ans=0 x=A[0] for i in range(1,n): if x>A[i]: ans+=1 print(ans)