N = input()

ll = map(int, raw_input().split())
ll.sort()

odds, evens = 0, 0

now = 1
for i in xrange(N/2):
    odds += abs(ll[i] - now)
    now += 2

now = 2
for i in xrange(N/2):
    evens += abs(ll[i] - now)
    now += 2

print min(odds, evens)