#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 10;
int arr[maxn];
int main() {
  int n, sum1 = 0, sum2 = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n / 2; i++) scanf("%d", arr + i);
  for (int i = 1; i <= n / 2; i++) {
    int x = arr[i];
    sum1 += abs(x - i * 2);
    sum2 += abs(x - (i * 2 - 1));
  }
  cout << min(sum1, sum2) << endl;
  return 0;
}
