t=int(input())
l=[int(x) for x in input().split()]
z1=[i for i in range(1,100,2)]
z2=[i for i in range(2,101,2)]
l.sort()
ans=0
if(l[0]==1):
    j=0
    for i in l:
        ans+=abs(i-z1[j])
        j+=1
else:
    j=0
    for i in l:
        ans+=abs(i-z2[j])
        j+=1
print(ans)
