#include <bits/stdc++.h>
using namespace std;
void DBG() {
  cerr << "]"
       << "\n";
}
template <class H, class... T>
void DBG(H h, T... t) {
  cerr << h;
  if (sizeof...(t)) cerr << ", ";
  DBG(t...);
}
template <class H>
void DBG(vector<H> v) {
  for (int i = 0; i < (int)v.size(); i++) {
    cerr << v[i];
    if (i != (int)v.size() - 1) cerr << ", ";
  }
  cerr << ']' << "\n";
}
long long randNum(long long a, long long b) { return a + rand() % (b - a + 1); }
long long mPow(long long b, long long p, long long m) {
  b %= m;
  long long result = 1;
  while (p > 0) {
    if (p & 1) result = (result * b) % m;
    b = (b * b) % m;
    p >>= 1;
  }
  return result;
}
long long gcdExtended(long long a, long long b, long long *x, long long *y) {
  if (a == 0) {
    *x = 0, *y = 1;
    return b;
  }
  long long x1, y1;
  long long gcd = gcdExtended(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
long long modInverse(long long b, long long m) {
  long long x, y;
  long long g = gcdExtended(b, m, &x, &y);
  if (g != 1) return -1;
  return (x % m + m) % m;
}
long long modDivide(long long a, long long b, long long m) {
  a = a % m;
  long long inv = modInverse(b, m);
  if (inv == -1)
    return -1;
  else
    return (inv * a) % m;
}
unsigned long long nCrModPFermat(unsigned long long n, int r, int p) {
  if (n < (unsigned long long)r) return 0;
  if (r == 0) return 1;
  unsigned long long fac[n + 1];
  fac[0] = 1;
  for (unsigned long long i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % p;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
bool sortfunc(pair<int, int> a, pair<int, int> b) { return a.first < b.first; }
long long gcd(long long a, long long b) { return (b == 0) ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
const int dx4[4] = {-1, 0, 1, 0}, dy4[4] = {0, -1, 0, 1};
const int dx8[8] = {-1, -1, -1, 0, 0, 1, 1, 1},
          dy8[8] = {0, 1, -1, -1, 1, 0, 1, -1};
void solve() {
  int n;
  cin >> n;
  vector<int> v(n / 2, 0);
  for (int i = 0; i < n / 2; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end());
  int j = 1, k = 2;
  int ans1 = 0, ans2 = 0;
  for (int i = 0; i < n / 2; i++) {
    ans1 += abs(v[i] - j);
    ans2 += abs(v[i] - k);
    k += 2;
    j += 2;
  }
  if (ans1 < ans2)
    cout << ans1 << "\n";
  else
    cout << ans2 << "\n";
}
signed main() {
  ios::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  solve();
  return 0;
}
