#-*- coding:utf-8 -*-


n = int(input())
str = input()
intvec = str.split(' ')
mymap = map(int,intvec)

data = list()

for itr in mymap:
    data.append(itr)

data.sort()


cnt = 1

cost_odd = 0
cost_even = 0

for itr in data:
    cost_odd = abs(itr - cnt) + cost_odd
    cost_even = abs(itr - cnt - 1) + cost_even
    cnt = cnt + 2

print(min(cost_odd,cost_even))
