	import java.util.*;
	import java.math.*;
	import java.io.*;
	public class A{
		public static void main(String[] args) {
			MyScanner scan = new MyScanner();
			PrintWriter pw = new PrintWriter(System.out);
			int n = scan.nextInt();
			int arr[] = new int[n/2];
			for(int i = 0;i<n/2;i++)
				arr[i] = scan.nextInt();
			int odd[] = new int[n/2 + 1];
			int even[] = new int[n/2 + 1];
			int i1 = 1,i2 = 1;
			for(int i = 1;i<=n;i++)
			{
				if (i%2 == 0)
					even[i1++] = i;
				else
					odd[i2++] = i;
			}
			Arrays.sort(arr);
			int max1 = 0;
			for(int i = 1;i<=n/2;i++)
			{
				max1+=(Math.abs(even[i] - arr[i-1]));
			}
			int max2 = 0;
			for(int i = 1;i<=n/2;i++)
			{
				max2+=(Math.abs(odd[i] - arr[i-1]));
			}
			pw.print(Math.min(max1,max2));
			pw.print("\n");
			pw.close();
		}

	}
	class MyScanner {
    BufferedReader br;
    StringTokenizer st;

    public MyScanner() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    public int mod(long x) {
        // TODO Auto-generated method stub
        return (int) x % 1000000007;
    }

    public int mod(int x) {
        return x % 1000000007;
    }

    boolean hasNext() {
        if (st.hasMoreElements())
            return true;
        try {
            st = new StringTokenizer(br.readLine());
        } catch (IOException e) {
            e.printStackTrace();
        }
        return st.hasMoreTokens();
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

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

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

    String nextLine() {
        String str = "";
        try {
            str = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return str;
    }

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