import java.io.*;
import java.util.*;
public class hi
{
    public static void main(String args[]) throws IOException
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(br.readLine());
          int[] ar=new int[n+1];
          int[] even=new int[n/2+1];
          int[] odd=new int[n/2+1];
          int sum1=0,sum2=0;
            String n1[]=br.readLine().split(" ");
           for(int i=0;i<n/2;i++)
           {
               ar[i]=Integer.parseInt(n1[i]);
          //System.out.println(ar[i]);
           }
                  even[0]=2;
           for(int i=1;i<n/2;i++)
           {
               even[i]=even[i-1]+2;
            }
                  odd[0]=1;
           for(int i=1;i<n/2;i++)
           {
               odd[i]=odd[i-1]+2;
            }
           for(int i=0;i<n/2;i++)
           {
               sum1+=Math.abs(ar[i]-even[i]);
           }
           for(int i=0;i<n/2;i++)
           {
               sum2+=Math.abs(ar[i]-odd[i]);
           }
           System.out.println(((sum1>sum2)?sum2:sum1));
    
    }
}