#include <bits/stdc++.h>
using namespace std;
int n, a[60];
int abs(int x) { return x > 0 ? x : -x; }
int f(int x) {
  int sum = 0;
  for (int i = 0; i < n / 2; ++i) sum += abs(i * 2 + x - a[i]);
  return sum;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n / 2; ++i) scanf("%d", a + i);
  sort(a, a + n / 2);
  printf("%d", min(f(1), f(2)));
  return 0;
}
