import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class ProbA
{
    public static void main(String[] args)
    {
        Scanner input = new Scanner(System.in);

        int n = input.nextInt();

        List<Integer> evens = new ArrayList<Integer>();
        List<Integer> odds = new ArrayList<Integer>();
        List<Integer> evensUnchanged = new ArrayList<Integer>();
        List<Integer> oddsUnchanged = new ArrayList<Integer>();

        for (int i = 0; i < n / 2; i++)
        {
            int next = input.nextInt();

            if(next%2 == 0)
            {
                evens.add(next);
                evensUnchanged.add(next);
            }
            else
            {
                odds.add(next);
                oddsUnchanged.add(next);
            }
        }
        Collections.sort(evens);
        Collections.sort(odds);

        int oCount = 0;

        for (int j = 1; j <= n; j += 2)
        {
            if(!oddsUnchanged.contains(j))
            {
                oCount += Math.abs(j - evens.get(0));
                evens.remove(0);
            }
        }
        int eCount = 0;

        for(int k = 2; k <= n; k+=2)
        {
            if(!evensUnchanged.contains(k))
            {
                eCount += Math.abs(k - odds.get(0));
                odds.remove(0);
            }
        }
        System.out.println(Math.min(oCount, eCount));
    }
}