n = list(map(int, input().split()))

nums = sorted(list(map(int, input().split())))

act1 = 0
act2 = 0
for i,x in enumerate(nums):
    act1 += abs(2 * i + 1 - x)
    act2 += abs(2 * i + 2 - x)

print(min(act1, act2))