import math

n = int(raw_input())

piecesconfig = map(int, raw_input().split(" ")[:n/2])
piecesconfig = sorted(piecesconfig)

piecessum = 0

movessum = 0

evenconfig = []
oddconfig = []
evensum = 0
oddsum = 0
for i in range(1, n + 1):
	if (i % 2 == 0):
		evenconfig.append(i)
		evensum += i
	else:
		oddconfig.append(i)
		oddsum += i

for i in piecesconfig:
	piecessum += i


if abs(piecessum - evensum) > abs(piecessum - oddsum):
	for i in range(len(piecesconfig)):
		movessum += abs(piecesconfig[i] - oddconfig[i])
	print movessum
elif abs(piecessum - evensum) < abs(piecessum - oddsum):
	for i in range(len(piecesconfig)):
		movessum += abs(piecesconfig[i] - evenconfig[i])
	print movessum
