n=int(input())
ns=[int(x) for x in input().split()]
ns.sort()
num=n//2
ans1=0
for i in range(num):
    ans1+=abs(ns[i]-i*2-2)
ans2=0
for i in range(num):
    ans2 += abs(ns[i] - i * 2-1)
# print(ans1)
# print(ans2)
print(min(ans1,ans2))