n = int(input())
ls = list(map(int, input().split()))
ls.sort()
sum1 = 0
sum2 = 0
temp = 0
for i in range(1, n+1, 2):
    sum1 += (abs(ls[temp] - i))
    temp += 1
temp = 0
for i in range(2, n+1, 2):
    sum2 += (abs(ls[temp] - i))
    temp += 1
print(min(sum1, sum2))