#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p;
  scanf("%d", &n);
  int tab[100];
  for (int i = 0; i < n / 2; ++i) {
    scanf("%d", &p);
    tab[i] = p;
  }
  int impair = 1, sum1 = 0;
  int pair = 2, sum2 = 0;
  for (int i = 0; i < n / 2; ++i) {
    sum1 += abs(impair - tab[i]);
    impair += 2;
  }
  for (int i = 0; i < n / 2; ++i) {
    sum2 += abs(pair - tab[i]);
    pair += 2;
  }
  printf("%d", min(sum1, sum2));
}
