import java.io.*;
import java.util.*;

public class Solution {

    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;
    boolean eof;

    static final int Mod = 1000000007;

    void solve() throws IOException {
        int n = nextInt();
        int a[] = new int[n / 2];
        for (int i = 0; i < n / 2; i++) {
            a[i] = nextInt();
        }
        Arrays.sort(a);
        int ans = Integer.MAX_VALUE;
        int even = 0, odd = 0;
        int x = 0;
        for (int i = 1; i <= n; i += 2) {
            odd += Math.abs(a[x++] - i);
        }
        x = 0;
        for (int i = 2; i <= n; i += 2) {
            even += Math.abs(a[x++] - i);
        }
        ans = Math.min(even, odd);
        out.println(ans);
    }

    Solution() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }

    public static void main(String[] args) throws IOException {
        new Solution();
    }

    String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }

    String nextString() {
        try {
            return br.readLine();
        } catch (IOException e) {
            eof = true;
            return null;
        }
    }

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

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

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