n=int(input())
a=sorted(list(map(int,input().split())))
k1,k2,i,a1,a2=1,2,0,0,0
while i<len(a):
    if a[i]>k1:
        a1+=(a[i]-k1)
    else:
        a1+=(k1-a[i])
    if a[i]>k2:
        a2+=(a[i]-k2)
    else:
        a2+=(k2-a[i])
    i+=1
    k1+=2
    k2+=2
print(min(a1,a2))

        
    

