n=input()
a=map(int,raw_input().split())
a.sort()
ans=0
ans1=0
#print a
for i in range(1,n+1,2):
    idx=(i-1)/2
    ans+=abs(i-a[idx])
for i in range(2,n+1,2):
    idx=(i-1)/2
    ans1+=abs(i-a[idx])
print min(ans,ans1)
    
    
    

    