def main():
    N = int(input())
    in_p_list = list(map(int, input().split()))
    p_list = [1+i-p for i,p in enumerate(in_p_list)]

    cnt = 1 if p_list[0] == 0 else 0
    for i in range(1,N):
        v = p_list[i]
        if p_list[i-1] == 0:
            continue
        if v != 0:
            continue
        cnt += 1
    print(cnt)


if __name__ == "__main__":
    main()