#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int c[n / 2];
  for (int i = 0; i < n / 2; ++i) {
    scanf("%d", &c[i]);
  }
  sort(c, c + n / 2);
  int o = 0, e = 0;
  for (int i = 0; i < n / 2; ++i) {
    o += abs(i * 2 + 1 - c[i]);
    e += abs(i * 2 + 2 - c[i]);
  }
  printf("%d\n", min(o, e));
}
