import java.util.*;

public class Main{
	
	public static void main(String args[]){
		
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int arr[] = new int[n + 1];
		int b[] = new int[n];
		int w[] = new int[n];
		arr[0] = -1;
		int bC = 0, wC = 0;
		for(int i = 1; i <= n/2; i++){
			int num = sc.nextInt();
			arr[num] = 1;
			
		}
		
		for(int i = 1; i < arr.length; i++){
			if(i%2 == 1 && arr[i] == 0){
				b[bC++] = i;
			} else if(i%2 == 0 && arr[i] == 0){
				w[wC++] = i;
			}
		}
		System.out.println(Math.min(black(arr,b,w), white(arr,b,w)));
		
	}
	
	public static int black(int arr[], int b[], int w[]){
		int moves = 0;
    for(int i = 1; i < arr.length; i++){
			if(arr[i] == 1 && i % 2 == 0){
				for(int k = 0; k < b.length;k++){
          if(b[k] != 0){
            int diff = Math.abs(b[k] - i);
            moves += diff;
            b[k] = 0;
            break;
          }
        }
			}
		}
    return moves;
	}
	
	public static int white(int arr[], int b[], int w[]){
    int moves = 0;
    for(int i = 1; i < arr.length; i++){
			if(arr[i] == 1 && i % 2 == 1){
				for(int k = 0; k < w.length;k++){
          if(w[k] != 0){
            int diff = Math.abs(w[k] - i);
            moves += diff;
            w[k] = 0;
            break;
          }
        }
			}
		}
    return moves;
  }
	
}