import java.util.*;
import java.io.*;
import java.lang.*;

public class chess{
	
	public static void main(String[] args)
    {
		FastReader f = new FastReader();
		PrintWriter wr = new PrintWriter(System.out);
        int n;
        n = f.nextInt();
        int[] array = new int[n/2];
        for(int i=0;2*i<n;i++)
        {
            array[i] = f.nextInt();
        }

        Arrays.sort(array);

        int black=0;
        int white=0;
        for(int i=0;2*i<n;i++)
        {
            black+= Math.abs(array[i] - (i*2 + 1));
        }
        for(int i=0;2*i<n;i++)
        {
            white+= Math.abs(array[i] - (i*2 +2));
        }

        wr.println(Math.min(white,black));
        wr.close();
	}

	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }
 
        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt()
        {
            return Integer.parseInt(next());
        }
 
        long nextLong()
        {
            return Long.parseLong(next());
        }
 
        double nextDouble()
        {
            return Double.parseDouble(next());
        }
 
        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}