n = int(input())
l = [int(x) for x in input().split()]
l.sort()

ans1 = ans2 = 0

for i in range(len(l)-1,-1,-1):
    ans1 += (abs(l[i] - (i+1)*2 ) ) 
    ans2 += (abs(l[i] - ((i+1)*2 - 1) ))

print(min(ans1,ans2))