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