n = int(input())
arr = list(input().split())
for i in range(0, int(n / 2)):
    arr[i] = int(arr[i])
arr = sorted(arr)
res1 = res2 = 0
for i in range(0, int(n / 2)):
    res1 += abs(2 * i + 1 - arr[i])
for i in range(0, int(n / 2)):
    res2 += abs(2 * i + 2 - arr[i])
print(min(res1, res2))