n=int(input())
t1,t2=0,0
k1,k2=1,1
a=list(map(int,input().split()))
a.sort()
for i in range(1,n//2+1):
	t1+=abs(2*i-a[i-1])
	#if i<=n//2 and a[i]
	t2+=abs(2*i-1-a[i-1])
#print(t1)
#print(t2)
print(min(t1,t2))
