#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("O2")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
struct pair_hash {
  inline std::size_t operator()(
      const std::pair<long long, long long>& v) const {
    return v.first * 31 + v.second;
  }
};
const long long mod = 1e9 + 7;
vector<long long> binarycut(long long x) {
  vector<long long> v;
  while (x) {
    if (x & 1)
      v.emplace_back(1);
    else
      v.emplace_back(0);
    x >>= 1;
  }
  reverse(v.begin(), v.end());
  return v;
}
long long takemod(long long a) { return ((a % mod) + mod) % mod; }
long long fast_exp(long long base, long long expo) {
  long long res = 1;
  while (expo > 0) {
    if (expo & 1) res = (res * base) % mod;
    base = (base * base) % mod;
    expo >>= 1;
  }
  return res;
}
long long modinv(long long a) { return takemod(fast_exp(takemod(a), mod - 2)); }
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  time_t t1, t2;
  t1 = clock();
  long long n;
  cin >> n;
  n /= 2;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  long long res1 = 0, res2 = 0;
  long long cur = 1, cur2 = 2;
  for (long long i = 0; i < n; i++) {
    res1 += abs(a[i] - cur);
    res2 += abs(a[i] - cur2);
    ;
    cur += 2;
    cur2 += 2;
  }
  cout << min(res1, res2);
  t2 = clock();
  cerr << "time taken: " << t2 - t1;
  return 0;
}
