n=int(input())
x=int(n/2)
a=[1]*x
#for i in range(x):
    #a[i]=int(input())
a = [int(a) for a in input().split()]
a.sort()

white=0
black=0
position=1
i=0
while i<x:
    black=black+abs(a[i]-position)
    i=i+1
    position+=2
i=0
position=2
while i<x:
    white=white+abs(a[i]-position)
    i=i+1
    position+=2
if white<=black:
    print(white)
else:
    print(black)