N = int(input())
R = list(map(int, input().split()))

l,r = 0,1
cnt = 0
while r < N:
    tmp = r
    r = max(R[l:r])
    l = tmp
    cnt += 1
print(cnt)