import java.util.ArrayList;
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> pieces1 = new ArrayList<Integer>();
        List<Integer> pieces2 = new ArrayList<Integer>();

        for(int i = 0; i < n/2; i++)
        {
            int next = input.nextInt();
            pieces1.add(next);
            pieces2.add(next);
        }
        int oCount = 0;

        for(int j = 1; j <= n; j+=2)
        {
            if (!pieces1.contains(j))
            {
                int closestPiece = 1000;

                for (int a = 2; a <= n; a += 2)
                {
                    if(pieces1.contains(a) && Math.abs(j - a) < Math.abs(j-closestPiece))
                        closestPiece = a;
                }
                pieces1.remove(new Integer(closestPiece));
                oCount += Math.abs(j-closestPiece);
            }
        }
        int eCount = 0;

        for(int k = 2; k <= n; k+=2)
        {
            if(!pieces2.contains(k))
            {
                int closestPiece = 1000;

                for(int a = 1; a <= n; a+=2)
                {
                    if(pieces2.contains(a) && Math.abs(k-a) < Math.abs(k-closestPiece))
                        closestPiece = a;
                }
                pieces2.remove(new Integer(closestPiece));
                eCount += Math.abs(k-closestPiece);
            }
        }
        System.out.println(Math.min(eCount, oCount));
    }
}
