n = int(input()) A = list(map(int, input().split())) A.sort() B = list(range(1, n+1)) ans = 0 for i in range(n): ans += abs(A[i]-B[i]) print(ans)