#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int a[110];
  for (int i = 1; i <= n / 2; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + n / 2 + 1);
  int ans = 0;
  int sume = 0, sumo = 0;
  for (int i = 1; i <= n / 2; i++) {
    sume += abs(a[i] - i * 2);
    sumo += abs(a[i] - (2 * i - 1));
  }
  cout << min(sume, sumo) << endl;
  return 0;
}
