n = int(input())
positions = []
positions += [int(x) for x in input().split(" ")]
positions = list(reversed(sorted(positions)))

## Check the moves required to move all to odds:
odds = list(reversed(list(range(1,n,2))))
evens = list(reversed(list(range(2,n+2,2))))

sum_odds = 0
for p in positions:
    sum_odds += abs(p - odds[0])
    odds.pop(0)

sum_evens = 0
for p in positions:
    sum_evens += abs(p - evens[0])
    evens.pop(0)

print(min(sum_odds,sum_evens))
