#ZadA
import math
n=int(input())
line=list(map(int,input().split()))
line.sort()
ans_black=0
ans_white=0
counter=1
for i in line:
    ans_black+=int(math.fabs(counter-i))
    counter+=2
counter=2
for i in line:
    ans_white+=int(math.fabs(counter-i))
    counter+=2
print(min(ans_white,ans_black))