/*
   #######  ######    #####  ######  ######  #####
    #    #  #    #      #    #    #  #    #    #
    #    #  # #  #      #    # ## #  # ## #    #
    #    #  #  #    #   #    #    #  #    #    #
   #######  #   #   # # #    #    #  #    #    #
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.io.*;
import java.math.*;
import java.util.StringTokenizer;
public class chessPlacing {
    static PrintStream out = System.out;
    static long mod = (long)10e9+7;
    public static void main(String args[] ) throws Exception {
        int n = nextInt();
        int arr[] = inta(n/2);
        long ans =0,ans1 =0;
        for(int i=0;i<n/2;i++){
            ans += Math.abs(arr[i]-(i*2+1));
            ans1 += Math.abs(arr[i]-(i*2+2));
        }
        out.println(Math.min(ans,ans1));
    }


//-------------------------------------------------fast Method---------------------------------------------------------------\\
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));;
    static StringTokenizer st;
    private static int[] inta(int n){
        int [] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = nextInt();
            return a;
    }
    private static long[] longa(long n){
    long[] a = new long[(int)n];
        for(int i = 0;i < n;i++)a[i] = nextLong();
            return a;
    }
    private static void pla(long[] a){
        for(int i = 0;i <a.length;i++)
            out.print(a[i]+" ");
    }
    private static void pia(int[] a){
        for(int i = 0;i <a.length;i++)
            out.print(a[i]+" ");
    }
    private static String next(){
        while (st == null || !st.hasMoreElements()){
            try{
                st = new StringTokenizer(br.readLine());
            }
            catch (IOException  e){
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }
    private static int nextInt(){
        return Integer.parseInt(next());
    }

    private static long nextLong(){
        return Long.parseLong(next());
    }

    private static double nextDouble(){
        return Double.parseDouble(next());
    }
    private static String nextLine(){
        String str = "";
        try{
            str = br.readLine();
        }
        catch (IOException e){
            e.printStackTrace();
        }
        return str;
    }
//-------------------------------------------------fast Method---------------------------------------------------------------\
}