import java.util.*;
import java.io.*;
public class chess
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
    static BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out));
    static StringTokenizer st=null;
    static String next()
    {
        while(st==null || !st.hasMoreElements())
        {
            try{
                st=new StringTokenizer(br.readLine());
            } catch (IOException e){
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }
    static int nextInt()
    {
        return Integer.parseInt(next());
    }
    static long nextLong()
    {
        return Long.parseLong(next());
    }
    
    static double nextDouble(){
        return Double.parseDouble(next());
    } 
   public static void main(String[] args) {
        try{
                int n=nextInt();
                int ar[];
                ar=new int[n/2];
                for(int i=0;i<(n/2);i++)
                {
                    ar[i]=nextInt();
                }
                Arrays.sort(ar);
                int sum1=0;
                int sum2=0;
                for(int i=0;i<(n/2);i++)
                {
                    sum1+=Math.abs(ar[i]-(2*i+1));
                    sum2+=Math.abs(ar[i]-(2*i+2));
                    //bw.write("i="+i+" sum1="+sum1+" sum2="+sum2+"\n");
                }
                bw.write(Math.min(sum1,sum2)+"\n");
                 bw.flush();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}