import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.Reader;
import java.io.StreamTokenizer;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.function.Function;

import static java.lang.Math.min;
import static java.lang.Math.max;
import static java.lang.Math.abs;



public class Main {
	//private static Scanner scan;
	private static PrintStream out;
	private static InputReader in;
    
   
    
    
    public static void main (String ... args) throws IOException {
		//scan = new Scanner(System.in);
		in = new InputReader(System.in);
    	out = new PrintStream(System.out);
		int min = Integer.MAX_VALUE;
    	
    	int n = in.nextInt();
    	int[] arr = new int[n / 2];
    	for (int i = 0; i < n / 2; i++) arr[i] = in.nextInt();
    	
    	int c = 0;
    	for (int i = 1; i <= n / 2; i++) {
    		c += abs(arr[i - 1] - (2 * i - 1)); 
    	}
    	//out.println(c);
    	min = c;
    	c = 0;
    	
    	for (int i = 1; i <= n / 2; i++) {
    		c += abs(arr[i - 1] - (2 * i)); 
    	}
    	out.println(min(min, c));
    	
    }	
    
    
    
    //(a, b) in T^2
    static class Pair<T> {
    	T a = null, b = null;
    	
    	public Pair (T a, T b) {this.a = a; this.b = b;}
    	public T first() {return this.a;}
    	public T second() {return this.b;}
    	public Pair<T> copy () {return new Pair(a, b);}
    	public String toString () {return a.toString() + " " + b.toString();}
    }
    
 
  
    


	
	
	// algos
	// 1. prime(int n)          O(sqrt(n))
	// 2. eratoSieve(int n)     O(nloglog(n))
	/////////////////////////////////////////////////////////////////
	
	
	// literally a functor Obj -> Str
    public static void term (Object o) {
    	out.println(o.toString());
    	System.exit(0);
    }
	
	
	// returns (int -> boolean: prime(a))   complexity(O(sqrt(n))
	public static boolean isPrime (int a) {
		if (a == 2 || a == 3 || a == 5) return true;
		if (a % 2 == 0 || a % 3 == 0 || a % 5 == 0) return false;
		
		int sqrt = (int) Math.sqrt(a);
		for (int i = 7; i <= sqrt; i += 2) if (a % i == 0) return false;
		return true;
	}
	


	
	// get all primes in [2, maxValue - 1] in O(nloglog(n))
	public static ArrayList<Integer> eratoSieve (int maxValue) {
		boolean[] isPrime = new boolean[maxValue];
        Arrays.fill(isPrime, true);
        ArrayList<Integer> ret = new ArrayList<>();
        for (int value = 2; value < maxValue; ++value) {
            if (isPrime[value]) {
                ret.add(value);
                for (int i = 2 * value; i < maxValue; i += value) {
                    isPrime[i] = false;
                }
            }
        }
        return ret;
	}
	
	static List<Integer>[] getGraphMatrix (int n) {
    	List<Integer>[] graph = new ArrayList[n];
        for (int i = 0; i < n; i++) graph[i] = new ArrayList<>();
        return graph;
    }
	
	static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
        
        public double nextDouble () {
        	return Double.parseDouble(next());
        }

    }
}