n=int(input())
a=list(map(int,input().split(' ')))
a=sorted(a)
c=2
d=1
e=0
f=0
for i in range(len(a)):
        e=e+abs(a[i]-c)
        c=c+2
for i in range(len(a)):
        f=f+abs(a[i]-d)
        d=d+2
if e>f:
        print(f)
else:
        print(e)
        
        
                
        
