n = input()
arr = map(int,raw_input().strip().split())
arr.sort()

odd = 1
even = 2

ao = 0
ae = 0
for val in arr:
    ao += abs(val-odd)
    ae += abs(val-even)
    odd += 2
    even += 2
print min(ao,ae)