n = int(input())

A = [int(x) for x in input().split()]
A.sort()
ans1=0
ans2=0
for i in range(len(A)):
	diff = 2*i+1
	ans1 += abs(diff - A[i])

for i in range(len(A)):
	diff = 2*i+2
	ans2 += abs(diff - A[i])

print(min(ans1,ans2))
