N = int(input()) R = list(map(int, input().split())) start, end = 0, R[0]-1 dis = 1 while end < N-1: dis += 1 end2 = end for i in range(start+1, end+1): end2 = max(end2, R[i]) end = end2 print(dis)