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