def getlist(): return list(map(int, input().split())) N = int(input()) a = getlist() ans = 0 val = a[0] for i in range(N): if a[i] < val: ans += 1 if a[i] > val: val = a[i] print(ans)