#include <bits/stdc++.h>
using namespace std;
using tr1::unordered_map;
using tr1::unordered_set;
template <class T>
inline T _max(T a, T b) {
  return a > b ? a : b;
}
template <class T>
inline T _min(T a, T b) {
  return a < b ? a : b;
}
template <class T>
inline T _max(T a, T b, T c) {
  return _max(a, _max(b, c));
}
template <class T>
inline T _min(T a, T b, T c) {
  return _min(a, _min(b, c));
}
template <class T>
inline T _max(T a, T b, T c, T d) {
  return _max(a, _max(b, c, d));
}
template <class T>
inline T _min(T a, T b, T c, T d) {
  return _min(a, _min(b, c, d));
}
inline char gtc() {
  static char bfi[100000], *ci = bfi - 1, *cl = ci;
  return ci == cl &&
                 (cl = (ci = bfi - 1) + fread(bfi, 1, 100000, stdin), ci == cl)
             ? EOF
             : *++ci;
}
void readbit(double &ret, double bit = 0.1) {
  char chr;
  if (chr = gtc(), isdigit(chr))
    ret += (chr ^ 48) * bit, readbit(ret, bit * 0.1);
}
inline bool _read(int &res, bool flag = 0, int sum = 0) {
  char chr;
  while (chr = gtc(),
         !(isdigit(chr) || (chr ^ '-' ? 0 : (chr = gtc(), flag = 1))))
    if (chr == -1) return 0;
  while (isdigit(chr))
    sum = ((sum + (sum << 2)) << 1) + (chr ^ 48), chr = gtc();
  res = flag ? -sum : sum;
  return 1;
}
inline bool _read(unsigned int &res) {
  char chr;
  while (chr = gtc(), !isdigit(chr))
    if (chr == -1) return 0;
  res = 0;
  while (isdigit(chr))
    res = ((res + (res << 2)) << 1) + (chr ^ 48), chr = gtc();
  return 1;
}
inline bool _read(long long &res, bool flag = 0, long long sum = 0) {
  char chr;
  while (chr = gtc(),
         !(isdigit(chr) || (chr ^ '-' ? 0 : (chr = gtc(), flag = 1))))
    if (chr == -1) return 0;
  while (isdigit(chr))
    sum = ((sum + (sum << 2)) << 1) + (chr ^ 48), chr = gtc();
  res = flag ? -sum : sum;
  return 1;
}
inline bool _read(unsigned long long &res) {
  char chr;
  while (chr = gtc(), !isdigit(chr))
    if (chr == -1) return 0;
  res = 0;
  while (isdigit(chr))
    res = ((res + (res << 2)) << 1) + (chr ^ 48), chr = gtc();
  return 1;
}
inline bool _read(double &ret, bool flag = 0, long long sum = 0) {
  char chr;
  while (chr = gtc(),
         !(isdigit(chr) || (chr ^ '-' ? 0 : (chr = gtc(), flag = 1))))
    if (chr == -1) return 0;
  while (isdigit(chr))
    sum = ((sum + (sum << 2)) << 1) + (chr ^ 48), chr = gtc();
  if (ret = sum, chr == '.') readbit(ret);
  ret = flag ? -ret : ret;
  return 1;
}
inline bool _read(char &ch) {
  while (ch = gtc(), (ch == 32) || (ch == 10) || (ch == -1))
    if (ch == -1) return 0;
  return 1;
}
inline bool _read(char *p) {
  char chr;
  while (chr = gtc(), (chr == 32) || (chr == 10) || (chr == -1))
    if (chr == -1) return 0;
  while (chr ^ 10 && chr ^ 32 && ~chr) *p++ = chr, chr = gtc();
  *p = 0;
  return 1;
}
inline bool _read(string &s) {
  char chr, _s[128], *be = _s, *en = _s + 127;
  while (chr = gtc(), (chr == 32) || (chr == 10) || (chr == -1))
    if (chr == -1) return 0;
  *en = 0;
  while (chr ^ 10 && chr ^ 32 && ~chr) {
    *be++ = chr, be != en ? chr = gtc() : (be = _s, s += _s, chr = gtc());
  }
  *be = 0, s += _s;
  return 1;
}
template <class T, class U>
inline bool _read(pair<T, U> &res) {
  return _read(res.first), _read(res.second);
}
inline void ptc(char ch = 0) {
  static char bfo[100000], *co = bfo - 1, *coe = co + 100000;
  !ch || (*++co = ch, co == coe) ? fwrite(bfo, 1, co - bfo + 1, stdout),
      co = bfo - 1               : 0;
}
inline void _out(bool x) { ptc(x ? '1' : '0'); }
void _out(int x) {
  if (x < 0) ptc('-'), x = -x;
  if (x > 9) _out(x / 10);
  ptc(x % 10 ^ '0');
}
void _out(unsigned int x) {
  if (x > 9) _out(x / 10);
  ptc(x % 10 ^ '0');
}
void _out(long long x) {
  if (x < 0) ptc('-'), x = -x;
  if (x > 9) _out(x / 10);
  ptc(x % 10 ^ '0');
}
void _out(unsigned long long x) {
  if (x > 9) _out(x / 10);
  ptc(x % 10 ^ '0');
}
inline void _out(double x, int n = 8) {
  if (x < 0) ptc('-'), x = -x;
  _out((long long)x), x -= (long long)x, ptc('.');
  while (n--) x *= 10, _out(long long(x) % 10);
}
inline void _out(const char ch) { ptc(ch); }
inline void _out(const char *p) {
  while (*p) ptc(*p++);
}
inline void _out(const string &s) {
  const char *p = s.c_str();
  while (*p) ptc(*p++);
}
template <class T, class U>
inline void _out(pair<T, U> x) {
  _out(x.first), _out(' '), _out(x.second);
}
struct basic_read {
  bool flag;
  template <class T>
  basic_read operator>>(T &x) {
    return flag = _read(x), *this;
  }
  template <class T>
  basic_read operator>>(T *x) {
    return flag = _read(x), *this;
  }
  operator void *() const { return flag ? (void *)this : 0; }
} Read;
struct basic_out {
  template <class T>
  basic_out operator<<(T x) {
    return _out(x), *this;
  }
} Out;
template <class T, class U>
inline istream &operator>>(istream &os, pair<T, U> &p) {
  return os >> p.first >> p.second;
}
template <class T, class U>
inline pair<T, U> operator+(const pair<T, U> &p1, const pair<T, U> &p2) {
  return make_pair((p1.first + p2.first), (p1.second + p2.second));
}
template <class T, class U>
inline pair<T, U> &operator+=(pair<T, U> &p1, const pair<T, U> &p2) {
  p1.first += p2.first, p1.second += p2.second;
  return p1;
}
template <class T, class U>
inline pair<T, U> operator-(const pair<T, U> &p1, const pair<T, U> &p2) {
  return make_pair((p1.first - p2.first), (p1.second - p2.second));
}
template <class T, class U>
inline pair<T, U> &operator-=(pair<T, U> &p1, const pair<T, U> &p2) {
  p1.first -= p2.first, p1.second -= p2.second;
  return p1;
}
const int primes[7] = {24443,   100271,   1000003,   1000333,
                       5000321, 98765431, 1000000123};
const int dx[] = {0, 1, 0, -1, 0, 1, -1, 1, -1};
const int dy[] = {-1, 0, 1, 0, -1, 1, -1, -1, 1};
inline int myrand(int mod) {
  return ((long long)rand() << 32 ^ (long long)rand() << 16 ^ rand()) % mod;
}
inline int rand(int a, int b) { return a + myrand(b - a + 1); }
inline void normmod(long long &x, long long mod) {
  x %= mod;
  if (x < 0) x += mod;
}
inline long long mulmod(long long x, long long n, long long mod) {
  long long ans =
      (x * n - (long long)((long double)x / mod * n + 0.00000001) * mod);
  return ans < 0 ? ans + mod : ans;
}
inline long long pmod(long long x, long long n, long long mod = 1000000007,
                      long long res = 1) {
  for (normmod(x, mod); n; x = x * x % mod, n >>= 1)
    n & 1 ? res = res * x % mod : 0;
  return res;
}
inline long long pmmod(long long x, long long n, long long mod = 1000000007,
                       long long res = 1) {
  for (normmod(x, mod); n; x = mulmod(x, x, mod), n >>= 1)
    n & 1 ? res = mulmod(res, x, mod) : 0;
  return res;
}
template <class T>
inline T gcd(T a, T b) {
  while (b) {
    T t = a % b, a = b, b = t;
  }
  return a;
}
template <class T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
void teble();
int main() {
  teble();
  ptc();
  return 0;
}
const int N = 1e6 + 5;
int a[N], b[N];
void teble() {
  int n, s1 = 0, s2 = 0, ans = 0;
  Read >> n;
  for (register int i = (1), _ = (n >> 1) + 1; i < _; ++i) {
    Read >> a[i];
    b[a[i]] = 1;
  }
  int l = 1;
  for (register int i = (1), _ = (n >> 1) + 1; i < _; ++i) {
    while (b[l * 2 - 1]) ++l;
    if (!(a[i] & 1)) s1 += abs(a[i] - l * 2 + 1), ++l;
  }
  l = 1;
  for (register int i = (1), _ = (n >> 1) + 1; i < _; ++i) {
    while (b[l * 2]) ++l;
    if (a[i] & 1) s2 += abs(a[i] - l * 2), ++l;
  }
  Out << _min(s1, s2) << '\n';
}
