import java.util.Scanner;

public class chess {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int size = n/2;
		int answer= 0;
		int[] arr = new int[size];
		for(int i = 0;i<size;i++){
			arr[i] = sc.nextInt();
		}
		int x = n- 1;
		for(int i = size - 1;i>0;i--){
			int value = x - arr[i];
			x = x - 2;
			if(value > 0)
				answer = answer + value;
			else 
				answer  = answer - value;
		}
		x = n;
		int white = 0;
		for(int i = size - 1;i > 0;i--){
			int value = arr[i] - x;
			x = x - 2;
			if(value > 0)
				white = white + value;
			else 
				white  = white - value;
		}
		if(answer <= white)
			System.out.println(answer);
		else
			System.out.println(white);
	}
}
