n=int(input())
l=sorted(list(map(int,input().split())))
o=[2*i+1 for i in range(n//2)]
e=[2*i+2 for i in range(n//2)]
s1,s2,k=0,0,0
for i in l:
    s1+=abs(i-o[k])
    
    k+=1
k=n//2-1
for i in reversed(l):
    s2+=abs(e[k]-i)
    k-=1
#print(s1,s2)
print(min(s1,s2))
