#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 10;
int a[N];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n / 2; i++) cin >> a[i];
  int cnt1 = 0, cnt2 = 0;
  for (int i = 1; i <= n / 2; i++) cnt1 += abs(a[i] - 2 * i);
  for (int i = 1; i <= n / 2; i++) cnt2 += abs(a[i] - (2 * i - 1));
  cout << min(cnt1, cnt2) << endl;
  return 0;
}
