n = input()
numbers = sorted(map(int, input().split()))

black, white = 0, 0
for i, number in enumerate(numbers, 1):
    black += abs(number - (i*2 - 1))
    white += abs(number - i*2)

print(min(black, white))
