n = int(input())
p = input().split()
i = 0
while(i<n//2):
    p[i] = int(p[i])
    i = i + 1
i = 0
m1 = 0
p.sort()
m2 = 0
while(i<n//2):
    m1 = m1 + abs(p[i]-(2*i+1))
    m2 = m2 + abs(p[i]-(2*i+2))
    i = i + 1
print(min(m1,m2))