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