n=int(input())
arr=list(map(int,input().split()))
arr.sort()
var1=2
su=0
for i in range(n//2):
    su+=abs(var1-arr[i])
    var1+=2
s=0
var=1
for i in range(n//2):
    s+=abs(var-arr[i])
    var+=2
print(min(s,su))
