N = int(input()) seqA = [int(i) for i in input().split()] seqA.sort() ans = 0 for i in range(N): ans += abs(i+1 - seqA[i]) print(ans)