a=input()
import math
c=[0]*(a+1)
b=map(int,raw_input().split())
b.sort()
s=0
for i in range(1,a+1,2):
    s+=math.fabs(b[i/2]-i)
m=0
for i in range(2,a+1,2):
    m+=math.fabs(b[(i-1)/2]-i)
l=min(s,m)
print int(l)
