n=int(input())
list1=[int(x) for x in input().split()]
list1.sort()
moves_odd=0
moves_even=0
start_odd=1
start_even=2
for i in list1:
    temp=i
    moves_odd+=abs(temp-start_odd);
    start_odd+=2;
    moves_even+=abs(temp-start_even);
    start_even+=2;
print(min(moves_even,moves_odd))