t = int(input())
li = [int(x) for x in input().split()]
li.sort()
odd = 0
even = 0
oddLi = [x for x in range(1,t+1,2)]
evenLi = [x for x in range(2,t+1,2)]
for i in range(t//2):
    odd += abs(li[i]-oddLi[i])
    even += abs(li[i]-evenLi[i])
print(min(odd,even))