import java.util.Scanner;

public class Chess{
	public static void main(String args[]){
		int n,count1=0,count2=1,s;
		Scanner sc = new Scanner(System.in);
		n=sc.nextInt();
		int[] arr = new int[n/2];
		for(int i=0;i<n/2;i++){
			arr[i]=sc.nextInt();
		}
		if(true){
			s=arr[0];
			for(int i=1;i<n/2;i++){
				s=s+2;
				count1=count1+pos(arr[i]-s);
			}
		}
		if(true){
			s=arr[0]+1;
			for(int i=1;i<n/2;i++){
				s=s+2;
				count2=count2+pos(arr[i]-s);
			}
		}
		if(count1<=count2){
		System.out.print(count1);}
		else{
			System.out.print(count2);
		}
		
	}
	public static int pos(int r){
		if(r<0) return -r;
		else return r;
	}
}