n = int(raw_input())
s = raw_input().split(" ")

B1 = list()
W1 = list()
B2 = list()
W2 = list()

for i in range(n/2):
	x = int(s[i])
	if (x % 2 == 0):
		W1.append(x)
	else:
		B1.append(x)

for i in range(1, n + 1):
	if (i % 2 == 0):
		if i not in W1:
			W2.append(i)
	else:
		if i not in B1:
			B2.append(i)

B1.sort()
W1.sort()
B2.sort()
W2.sort()

s1 = 0
s2 = 0

for i in range(len(B1)):
	s1 += abs(B1[i] - W2[i])

for i in range(len(B2)):
	s2 += abs(B2[i] - W1[i])

print min(s1, s2)