n = int(input())

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

c1 = 0
c2 = 0

for i in range(n//2):
     p = abs(l[i] - (2*i)-1)
     c1 += p
     #print(l[i], (2*i)+1, p)
for i in range(n//2):
    c2 += abs(l[i] - (i+1)*2)
    #print(c2)

print(min(c1, c2))


