n=int(input())
a=[int(j) for j in input().split()]
a.sort()
moves1=0
moves2=0
for i in range(n//2):
	moves1+=abs((2*i+1)-a[i])
	moves2+=abs((2*i+2)-a[i])
if(moves2>moves1):
	print(moves1)
else:
	print(moves2)