n = int(input())
fig = list(map(int, input().split()))
turn1 = 0
turn2 = 0
fig.sort()
for i in range(n // 2):
    turn1 += abs(fig[i] - (i * 2 + 1))
    turn2 += abs(fig[i] - (i * 2 + 2))
print(min(turn1, turn2))
