n = int(input()) ls = list(map(int,input().split())) ls.sort() sq = [i+1 for i in range(n)] sm = 0 for i,j in zip(sq,ls): sm += abs(i-j) print(sm)