#/usr/bin/env python
n = int(raw_input())
p = sorted([int(x) for x in raw_input().split()])
print min(sum([abs(x - y) for (x, y) in zip(p, [x for x in xrange(1, n + 1) if x % 2 == 1])]), sum([abs(x - y) for (x, y) in zip(p, [x for x in xrange(1, n + 1) if x % 2 == 0])]))