N = int(input()) A = [int(x) for x in input().split()] A = sorted(A) ans = 0 for i in range(1, N + 1): ans += abs(A[i - 1] - i) print(ans)