n = int(input())

pos = [int(x) for x in input().split()]
pos.sort()
arr1 = [0]*(n//2)
arr2 = [0]*(n//2)
ans1 = [0]*(n//2)
ans2 = [0]*(n//2)
sum1 = sum2 = 0
for i in range(n//2):
    arr1[i] = 2*(i+1)-1
    
for i in range(n//2):
    arr2[i] = 2*(i+1)
    
for i in range(n//2):
    ans1[i] = abs(arr1[i] - pos[i])
    ans2[i] = abs(arr2[i] - pos[i])
    
for i in range(n//2):
    sum1+=ans1[i]
    sum2+=ans2[i]
    
print(min(sum1,sum2))