#include <bits/stdc++.h>
using namespace std;
const int MX = 2e6 + 10;
const int mod = 1e9 + 7;
const long long int inf = 1LL << 62;
int dx4[] = {0, 0, -1, 1};
int dy4[] = {1, -1, 0, 0};
int dx[] = {1, 1, 1, 0, 0, -1, -1, -1};
int dy[] = {1, 0, -1, 1, -1, 1, 0, -1};
vector<long long int> v;
map<long long int, long long int> mp;
int main() {
  long long int mark[110];
  long long int n, m, k, q, t, cnt = 0, sum = 0, ans = 0, mx = -inf, mn = inf,
                               a, b, c, d, e, f, g, h, i, j, x, y, z, temp,
                               temp1;
  string s, s1, s2, s3;
  cin >> n;
  for (int i = 0; i < 105; i++) mark[i] = 0;
  for (int i = 0; i < n / 2; i++) {
    cin >> a;
    v.push_back(a);
    mark[a]++;
  }
  for (int i = 0; i < n / 2; i++) {
    a = v[i];
    for (x = 1; x <= n; x = x + 2) {
      if (a == x) {
        break;
      }
      if (mark[x] == 0) {
        mark[x] = 1;
        mark[a] = 0;
        break;
      }
    }
    cnt += fabs(a - x);
  }
  for (int i = 0; i < 105; i++) mark[i] = 0;
  for (int i = 0; i < n / 2; i++) {
    mark[v[i]]++;
  }
  long long int cnt1 = 0;
  for (int i = 0; i < n / 2; i++) {
    a = v[i];
    for (x = 2; x <= n; x = x + 2) {
      if (a == x) {
        break;
      }
      if (mark[x] == 0) {
        mark[x] = 1;
        mark[a] = 0;
        break;
      }
    }
    cnt1 += fabs(a - x);
  }
  cout << min(cnt, cnt1) << endl;
  return 0;
}
