n = int(input())
p = list(map(int, input().split()))

swap = 0
flag = 0
while True:
    flag = 0
    for i in range(n-1):
        if p[i] == i+1:
            p[i], p[i+1] = p[i+1], p[i]
            flag = 1
            swap += 1
            print(swap)

    if flag == 0:
        print(swap)
        break