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