n = int(input()) alst = list(map(int, input().split())) cnt = 0 alst.sort() for i, a in enumerate(alst, start = 1): cnt += abs(a - i) print(cnt)