#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ar[n / 2], br[n / 2], cr[n / 2];
  for (int i = 0; i < n / 2; i++) {
    cin >> ar[i];
    br[i] = 2 * (i + 1);
    cr[i] = 2 * i + 1;
  }
  int sum1 = 0, sum2 = 0;
  for (int i = 0; i < n / 2; i++) {
    sum1 += (abs(ar[i] - br[i]));
    sum2 += (abs(ar[i] - cr[i]));
  }
  if (sum1 < sum2)
    cout << sum1;
  else
    cout << sum2;
  return 0;
}
