n=int(input())
list1=[]
x=0
count=0
for i in range(n):
    list1.append(int(input()))
for a in list1:
    a=list1[x]
    if list1[x+1]<a:
       list1[x+1]=list1[x]
       list[x]=a
       count+=1
    x+=1
print(count)