n = int(input())
a = list(map(int, input().split()))
for i in range(n // 2):
    a[i] -= 1
a = sorted(a)

ans1 = 0
for i in range(n // 2):
    ans1 += abs(a[i] - 2 * i)
ans2 = 0
for i in range(n // 2):
    ans2 += abs(a[i] - (2 * i + 1))

print(min(ans1, ans2))