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