#####################################   
import atexit, io, sys, collections
buffer = io.BytesIO() 
sys.stdout = buffer
@atexit.register 
def write(): sys.__stdout__.write(buffer.getvalue())   
##################################### 
import collections, math
def f(n,ais):
	tis = [i for  i in range(1,n+1) if i%2]
	return sum([abs(ti - ai) for ti,ai in zip(ais,tis)])
def g(n,ais):
	tis = [i for  i in range(1,n+1) if i%2 == 0]
	return sum([abs(ti - ai) for ti,ai in zip(ais,tis)])
n = int(raw_input())
ais = map(int, raw_input().split())
ais.sort()
print min(f(n,ais), g(n,ais))