n = int(input())

numarr = [int(i) for i in input().split()]
numarr.sort()

count1 = 0
count2 = 0
for i in range(int(n/2)):
    count1 += abs((i+1)*2-1-numarr[i])
for i in range(int(n/2)):
    count2 += abs((i+1)*2-numarr[i])

print(count1 if count1<count2 else count2)