n=int(input()) t=sorted(map(int,input().split())) print(sum(abs(i-j) for i,j in enumerate(t,1)))