#include <bits/stdc++.h>
using namespace std;
const long long maxn = 10010;
int a[100];
int main(void) {
  int i, j, k;
  int n;
  while (~scanf("%d", &n)) {
    n = n / 2;
    memset(a, 0, sizeof(a));
    for (i = 0; i < n; i++) {
      scanf("%d", &a[i]);
    }
    sort(a, a + n);
    int t1, t2;
    t1 = t2 = 0;
    for (i = 0; i < n; i++) {
      t1 += abs((i + 1) * 2 - a[i]);
    }
    for (i = 0; i < n; i++) {
      t2 += abs(2 * i + 1 - a[i]);
    }
    if (t1 < t2) t2 = t1;
    printf("%d\n", t2);
  }
}
