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

// Solution

public class Main 
{    
  public static void main (String[] argv) 
  {
	  new Main();
  } 
     
  
  boolean test = false;
  public Main() {
	  FastReader in = new FastReader(new BufferedReader(new InputStreamReader(System.in)));
	  //FastReader in = new FastReader(new BufferedReader(new FileReader("Main.in")));
      int n = in.nextInt();
      int h = n / 2;
      int[] a = new int[h];
      for (int i = 0; i < h; i++) a[i] = in.nextInt() - 1;
      Arrays.sort(a);
      
      
      if (n==2) {
         System.out.println(0);
         return;
      }
      
      // put in 0, 2, 4,
      int d = 0;
      for (int i = 0, j = 0; i < h; i++, j += 2)      
          d += Math.abs(a[i] - j);
      if(test)System.out.println(d);
      int d1 = 0;
      for (int i = 0, j = 1; i < h; i++, j += 2)      
          d1 += Math.abs(a[i] - j);
      if(test)System.out.println(d1);
      if (d1 < d) d = d1;
      System.out.println(d);
  }
  
  
  static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader(BufferedReader in)
        {            
            br = in;
        }
 
        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    String line = br.readLine();
                    if (line == null || line.length() == 0) return "";
                    st = new StringTokenizer(line);
                }
                catch (IOException  e)
                {
                    return "";
                    //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)
            {
                return "";
                //e.printStackTrace();
            }
            return str;
        }
    }
}