t=input()
x=raw_input().split(" ")
li=[]
for i in x:
    li.append(int(i))
li=sorted(li)
j=1
k=2
val1=0
val2=0
for i in li:
    vv=j-int(i)
    vb=k-int(i)
    val1+=max(vv,-vv)
    val2+=max(vb,-vb)
    j=j+2
    k=k+2
print min(val1,val2)