#include <bits/stdc++.h>
using namespace std;
int n;
int p[110];
int ans1 = 0;
int ans2 = 0;
int ans = 0;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n / 2; i++) scanf("%d", &p[i]);
  for (int i = 1; i <= n / 2; i++) {
    if (p[i] != 2 * i - 1) {
      ans1 = ans1 + (abs(2 * i - 1 - p[i]));
    }
  }
  for (int i = 1; i <= n / 2; i++) {
    if (p[i] != 2 * i) ans2 = ans2 + (abs(2 * i - p[i]));
  }
  ans = min(ans1, ans2);
  printf("%d\n", ans);
}
