N = int(input()) L0 = list(range(1, N+1)) L1 = sorted(map(int, input().split())) c = 0 for i, j in zip(L0, L1): c += abs(i - j) print(c)