n=int(input())

li=input().split()
for i in range(0,len(li)):
    li[i]=int(li[i])
li.sort()
sum1=0
p1=1
sum2=0
p2=2
for i in li:
    sum1+=abs(p1-i)
    sum2+=abs(p2-i)
    p1+=2
    p2+=2
print(min(sum1,sum2))
