n= int(input())
alist = [int(x) for x in input().split()]
alist.sort();
t=0;
lc=[];
ll=[];
sumc=0;
suml=0;
h=int(n/2)
for i in range(h):
    t=t+2;
    lc.append(t);
t=-1;
for i in range(h):
    t=t+2;
    ll.append(t);
if n==2:
    print(0);
else:
    for i in reversed(range(h)):
        sumc=sumc+abs(lc[i]-alist[i]);
    for i in reversed(range(h)):
        suml=suml+abs(ll[i]-alist[i]);
    
    if sumc<suml:
        print(sumc);
    else:
        print(suml);
    
