n = int(input())
p = sorted([int(i) for i in input().split()])

ans1 = 0
cur = 1
for i in p:
    ans1 += abs(cur - i)
    cur += 2
ans2 = 0
cur = 2
for i in p:
    ans2 += abs(cur - i)
    cur += 2
print(min(ans1, ans2))