n = int(raw_input())
pieces = map(int, raw_input().split(" "))

pieces.sort()

black = 0
white = 0

i = 0
for piece in pieces:
	black += abs(piece - 1 - i)
	white += abs(piece - 2 - i)
	i += 2

print min(white, black)