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