#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int a[105];
  for (int i = 0; i < 105; i++) a[i] = 0;
  cin >> n;
  int s = 0;
  for (int i = 1; i <= n / 2; i++) {
    cin >> a[i];
    s += a[i];
  }
  int odd = n / 2 * n / 2;
  int eve = n * (n + 1) / 4;
  int count = 0;
  if ((int)abs(s - odd) < (int)abs(s - eve)) {
    for (int i = 1; i <= n / 2; i++) {
      count += (int)abs(a[i] - ((2 * i) - 1));
    }
  } else {
    for (int i = 1; i <= n / 2; i++) {
      count += (int)abs(a[i] - 2 * i);
    }
  }
  cout << count;
}
