n = input()
pos = sorted([int(x) for x in input().split(" ")])

ans1 = ans2 = 0

i = 1
for item in pos:
    ans1 += abs(item - i)
    ans2 += abs(item - i - 1)
    i += 2
    
print(min(ans1, ans2))
    
