n = int(input()) a = list(map(int, input().split())) a2 = [(a[i], i) for i in range(n)] a2.sort() ans = 0 forbidden = set() for i in range(n): if a2[i][1] not in forbidden: ans += 1 forbidden.add(a2[i][1] - 1) print(ans)