k = int(input())
ns = list(map(int, input().split()))
n = k//2
ns.sort()
ans1 = ans2 = 0
fs = [x for x in range(1,k+1,2)]
js = [x for x in range(2,k+1,2)]

for x in range(n):
    ans1 += abs(ns[x] - fs[x])
    ans2 += abs(ns[x] - js[x])

print(min(ans1, ans2))
