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