#include <bits/stdc++.h>
using namespace std;
int s[200], f[200];
int main() {
  int n, sum = 0, ans = 0;
  ios::sync_with_stdio(false);
  cin >> n;
  int a;
  for (int i = 1; i <= n / 2; i++) {
    cin >> a;
    s[a] = 1;
    f[a] = 1;
  }
  for (int i = 1; i <= n; i++) {
    if (i % 2 == 0 && !s[i]) {
      for (int j = 1; j <= n; j++) {
        if (s[j] && j % 2 != 0) {
          sum += abs(i - j);
          s[j] = 0;
          break;
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i % 2 != 0 && !f[i]) {
      for (int j = 1; j <= n; j++) {
        if (f[j] && j % 2 == 0) {
          ans += abs(i - j);
          f[j] = 0;
          break;
        }
      }
    }
  }
  ans = min(ans, sum);
  cout << ans << endl;
  return 0;
}
