# cook your code here
n=int(raw_input())
pos=map(int,raw_input().split(' '))
pos=sorted(pos)
odd=[2*i+1 for i in xrange(n/2)]
even=[2*i+2 for i in xrange(n/2)]
diff1=0
diff2=0
for i in xrange(n/2):
    diff1=diff1+abs(odd[i]-pos[i])
    diff2=diff2+abs(even[i]-pos[i])
    
print(min(diff1,diff2))    