#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int a[109];
    int sum2 = 0, sum1 = 0;
    for (int i = 0; i < n / 2; i++) {
      cin >> a[i];
    }
    sort(a, a + n / 2);
    int k = 1;
    for (int i = 0; i < n / 2; i++) {
      sum1 += abs(a[i] - k);
      k += 2;
    }
    k = 2;
    for (int i = 0; i < n / 2; i++) {
      sum2 += abs(a[i] - k);
      k += 2;
    }
    sum1 = min(sum1, sum2);
    cout << sum1 << endl;
  }
  return 0;
}
