n = int(input()) l = sorted(map(int, input().split())) y = [i+1 for i in range(n)] x = 0 for i, j in zip(l, y): x += abs(i - j) print(x)