import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class ChessPlacing {

	public static void main(String[] args) throws IOException {
		
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		
		
		int n;
		int temp1 = 0;
		int temp2 = 0;
		
		
		n = Integer.parseInt(st.nextToken());
		
		int i;
		
		int[] myArray = new int[n/2+1];
		
		
		StringTokenizer st1 = new StringTokenizer(br.readLine());
		for(i=1; i<=n/2; i++){
			
			myArray[i] = Integer.parseInt(st1.nextToken());
		}
		
		Arrays.sort(myArray);
		
		for(i=1; i<=n/2; i++) {
			temp1 += Math.abs(i*2 - 1 - myArray[i]);
			temp2 += Math.abs(i*2 - myArray[i]);
		}
		System.out.println(Math.min(temp1, temp2));
		}

	}


