n = int(input())
k = int(n/2)
s = 0
s1 = 0
s2 = 0
p = input().split()
for i in range(k):
    p[i] = int(p[i])
    s+=p[i]
p.sort()
minim = 1
maxim = n
for i in range(k):
    s1 += abs(p[i] - minim)
    minim += 2
    s2 += abs(maxim - p[k-i-1])
    maxim -= 2
if s1<s2:
    print(s1)
else:
    print(s2)
    
    
    
