#include <bits/stdc++.h>
int cmp(const void *a, const void *b) {
  int A = *(int *)a;
  int B = *(int *)b;
  if (A < B)
    return -1;
  else if (A == B)
    return 0;
  return 1;
}
int main() {
  int n, sumB, sumW;
  int p[101];
  scanf("%d", &n);
  for (int i = 0; i < n / 2; i++) scanf("%d", &p[i]);
  qsort(p, n / 2, sizeof(p[0]), cmp);
  sumB = 0;
  for (int i = 0; i < n / 2; i++) sumB = sumB + abs(p[i] - (i * 2 + 1));
  sumW = 0;
  for (int i = 0; i < n / 2; i++) sumW = sumW + abs(p[i] - (i * 2 + 2));
  if (sumB < sumW)
    printf("%d\n", sumB);
  else
    printf("%d\n", sumW);
  return 0;
}
