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