N = int(input()) R = list(map(int,input().split())) cnt = 1 now = 0 next = 0 for i in range(N-1): if i <= now: next = max(next,R[i]-1) else: cnt += 1 now = next next = max(next,R[i]-1) if next == N -1: break print(cnt)