N = int(raw_input()) A = map(int, raw_input().split()) A.sort() sum = 0 for i in range(0, N): sum += abs(A[i]-i-1) print sum