N = int(input()) A =[int(i)for i in input().split()] A =sorted(A) ans = 0 for i,j in enumerate(A): ans += abs(i+1-j) print(ans)