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