#include <bits/stdc++.h>
using namespace std;
const long long maxN = 1000;
const long long inf = 1e10;
const long long mod = 1e9 + 7;
long long n;
long long a[maxN], b = 0, w = 0, vtb, vtw;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (long long i = 1; i <= n / 2; i++) cin >> a[i];
  vtb = 1;
  vtw = 2;
  sort(a + 1, a + 1 + n / 2);
  for (long long i = 1; i <= n / 2; i++) {
    b += abs(a[i] - vtb);
    vtb += 2;
    w += abs(a[i] - vtw);
    vtw += 2;
  }
  long long res = min(b, w);
  cout << res;
  return 0;
}
