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

public class Main{
    public static void main(String[] args)throws IOException{
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	PrintWriter out = new PrintWriter(System.out);
	int n = Integer.parseInt(br.readLine());
	String s[] = br.readLine().split(" ");
	int p[] = new int[n/2];
	int pa = 0, pe = 0;
	for(int i = 0; i<n/2;i++){
	    p[i] = Integer.parseInt(s[i]); 
	}
	Arrays.sort(p);
	for(int i = 0; i<n/2;i++){
	    pa += Math.abs(p[i]-i*2+1);
	    pe += Math.abs(p[i]-(i*2+2));
	}
	out.println(Math.min(pa,pe));
	out.close();
    }
}
