t = int(input())
l = [int(i) for i in input().split()]
l.sort()
odd = [int(i) for i in range(1,t,2)]
even = [int(i) for i in range(2,t+1,2)]
o = 0
e = 0
for i in range(t//2):
    o += abs(odd[i] - l[i])
    e += abs(even[i] - l[i])
if o > e:
    print(e)
else:
    print(o)
    