#include <bits/stdc++.h>
using namespace std;
const int N = 1e6;
const int inf = 1e9 + 10;
const long long INF = 1e18 + 10;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  n /= 2;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i], a[i]--;
  sort(a, a + n);
  int res = 0, res1 = 0;
  for (int i = 0; i < n; i++) {
    res += abs(a[i] - (i * 2));
    res1 += abs(a[i] - (i * 2 + 1));
  }
  cout << min(res, res1) << "\n";
  return 0;
}
