N = int(input()) A = list(map(int, input().split())) ans = 0 mx = 0 for i in range(N): if A[i] < mx: ans += 1 mx = max(mx, A[i]) print(ans)