N = int(input().strip()) A = [int(i) for i in input().strip().split(' ')] print(sum([abs(x - y) for x, y in zip(sorted(A), range(1, N+1))]))