import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class A {
    public static void main(String[] args) throws Exception {
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        // Scanner scan = new Scanner(System.in);
        PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
        int n = Integer.parseInt(bf.readLine());
        StringTokenizer st = new StringTokenizer(bf.readLine());
        int[] a = new int[n/2]; for(int i=0; i<n/2; i++) a[i] = Integer.parseInt(st.nextToken());
        Arrays.sort(a);
        int min_odd = 0;
        int min_even = 0;
        Set<Integer> occupied = new HashSet<Integer>();
        for(int i : a) occupied.add(i);
        for(int i=0; i<n/2; i++) {
          int min_dist = Integer.MAX_VALUE;
          int val = -1;
          if(a[i] % 2 == 0) {
            for(int j=1; j<=n; j+=2) {
              if(!occupied.contains(j)) {
                if(min_dist >  Math.abs(a[i] - j)) {
                  min_dist = Math.abs(a[i] - j);
                  val = j;
                }
              }
            }
            occupied.remove(a[i]);
            occupied.add(val);
            min_odd += Math.abs(a[i]-val);
          }

        }
        occupied.clear();
        for(int i : a) occupied.add(i);
        for(int i=0; i<n/2; i++) {
          int min_dist = Integer.MAX_VALUE;
          int val = -1;
          if(a[i] % 2 == 1) {
            for(int j=2; j<=n; j+=2) {
              if(!occupied.contains(j)) {
                if(min_dist >  Math.abs(a[i] - j)) {
                  min_dist = Math.abs(a[i] - j);
                  val = j;
                }
              }
            }
            occupied.remove(a[i]);
            occupied.add(val);
            min_even += Math.abs(a[i]-val);
          }

        }
        out.println(Math.min(min_even, min_odd));
        // int n = Integer.parseInt(st.nextToken());
        // int n = scan.nextInt();

        out.close(); System.exit(0);
    }
}
