#include <bits/stdc++.h>
using namespace std;
int a, b, c, d, e, ans, n, vb;
string s;
struct sss {
  int a;
};
vector<int> v;
int main() {
  scanf("%d", &n);
  int ans_c = 0;
  int ans_b = 0;
  for (int i = 1; i <= n / 2; i++) {
    scanf("%d", &a);
    v.push_back(a);
  }
  sort(v.begin(), v.end());
  for (int i = 1; i <= n / 2; i++) {
    a = v[i - 1];
    if (a > 2 * i) {
      ans_b += a - (2 * i);
    } else {
      ans_b += (2 * i) - a;
    }
    if (a > (2 * i) - 1) {
      ans_c += a - ((2 * i) - 1);
    } else {
      ans_c += ((2 * i) - 1) - a;
    }
  }
  cout << min(ans_b, ans_c);
  return 0;
}
