n=int(input()) a=sorted(map(int,input().split())) b=range(1,n+1) print(sum(map(lambda x,y:abs(x-y),b,a)))