
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.Arrays;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.util.function.DoubleFunction;

public class Main {

    public static void main(String[] args) {
        InputReader reader = new InputReader(System.in);
        int n = reader.nextInt();
        int d =0;
        int d1=0;
        int t;
        int[] arr = new int[n/2];
  for (int i = 0; i<n/2;i++){
      arr[i] = reader.nextInt();
  }
  int i = arr.length;
  Arrays.sort(arr);
  while(n>0){
     t= n-1- arr[i-1] ;
     if(t<0)
         t=t*-1;
     d=d+t;
     n-=2;
     i--;
  }
  t=0;
  n=arr.length*2;
  i=arr.length;
    while(n>0){
     t=n- arr[i-1];
     if(t<0)
         t=t*-1;
     d1=d1+t;
     n-=2;
     i--;
  }
    if(d<d1)
            System.out.println(d);
    else
            System.out.println(d1);
    }

    static class InputReader {

        StringTokenizer tokenizer;
        BufferedReader reader;
        String token;
        String temp;

        public InputReader(InputStream stream) {
            tokenizer = null;
            reader = new BufferedReader(new InputStreamReader(stream));
        }

        public InputReader(FileInputStream stream) {
            tokenizer = null;
            reader = new BufferedReader(new InputStreamReader(stream));
        }

        public String nextLine() throws IOException {
            return reader.readLine();
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    if (temp != null) {
                        tokenizer = new StringTokenizer(temp);
                        temp = null;
                    } else {
                        tokenizer = new StringTokenizer(reader.readLine());
                    }

                } catch (IOException e) {
                }
            }
            return tokenizer.nextToken();
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }
    }
}
