import java.util.*;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.Scanner;
import java.util.StringTokenizer;
 
public class temp {

	
	void solve() throws IOException
	{
		FastReader sc=new FastReader();
		int n = sc.nextInt();
		int a[] = new int[n/2];
		
		for(int i=0;i<n/2;i++)
			a[i] = sc.nextInt();
		
		Arrays.sort(a);
		
		int count1=0,count2=0,idx=1,iddx=2;
		
		for(int i=0;i<n/2;i++)
		{
			if(a[i]!=idx)
				count1+=Math.abs(a[i]-idx);
			
			if(a[i]!=iddx)
				count2+=Math.abs(a[i] - iddx);
			
			idx+=2;
			iddx+=2;
		}
		
		System.out.println(Math.min(count1,count2));
	}
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		new temp().solve();
 
	}
	
	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;
        }
    }
 
}