from collections import defaultdict
_ = int(input())
ps = list(map(int, input().split()))
ps.sort()
even = list(range(2, _+1, 2))
odd = list(range(1, _, 2))
even_sum = 0;odd_sum = 0
for i in range(len(ps)):
    even_sum += abs(even[i] - ps[i])
    odd_sum += abs(odd[i] - ps[i])
print(min(even_sum, odd_sum))