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