n = int(input()) xs = list(map(int,input().split())) y = 0 ans = 0 for x in xs: if y < x: y = x else: ans += 1 print(ans)