import sys

n = int(sys.stdin.readline())
p = map(int, sys.stdin.readline().split(" "))

p.sort()

bpos = [x for x in xrange(1, n + 1, 2)]
wpos = [x for x in xrange(2, n + 1, 2)]
wans, bans = 0, 0

for i in xrange(0, len(p)):
    bans += abs(bpos[i] - p[i])
    wans += abs(wpos[i] - p[i])

print min(bans, wans)