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

ans = 0
for i, num in enumerate(p):
    if i + 1 == p[i]:
        temp = p[i]
        try:
            p[i] = p[i + 1]
            p[i + 1] = temp
        except IndexError:
            pass
        ans += 1

print(ans)
print(p)