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