import java.io.*;
import java.util.Arrays;
import java.util.Locale;
import java.util.StringTokenizer;

public class A {
    String fileName = "<name>";


    public void solve() throws IOException {
        int n = nextInt() / 2;
        Integer[] a = new Integer[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        int black = 0;
        int white = 0;
        Arrays.sort(a);
        for (int i = 0; i < n; i++) {
            black += Math.abs(a[i] - (2 * i + 1));
            white += Math.abs(a[i] - (2 * (i + 1)));
        }
        out.print(Math.min(black, white));
    }

    public void run() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    BufferedReader br;
    StringTokenizer in;
    PrintWriter out;

    public String nextToken() throws IOException {
        while (in == null || !in.hasMoreTokens()) {
            in = new StringTokenizer(br.readLine());
        }
        return in.nextToken();
    }

    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    public static void main(String[] args) throws IOException {
        Locale.setDefault(Locale.US);
        new A().run();
    }
}