n = int(input())
figs = sorted(list(map(int, input().split())))

sum1 = 0
sum2 = 0

for i in range(n // 2):
    sum1 += abs(figs[i] - (2 * i + 1))
    sum2 += abs(figs[i] - (2 * i + 2))

print(min(sum1, sum2))
