#include <bits/stdc++.h>
using namespace std;
long long int n, m, b, g, a[505], t, ans = 0, p[100105];
long long temp1 = 0, temp2;
vector<int> prime;
int main() {
  cin >> n;
  for (int i = 1; i <= n / 2; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n / 2 + 1);
  if (a[1] > 2) {
    for (int i = 1; i <= n / 2; i++) {
      temp1 += (abs(a[i] - 2 * i));
      temp2 += (abs(a[i] - 2 * i + 1));
    }
    cout << min(temp1, temp2);
  } else {
    for (int i = n / 2; i >= 1; i--) {
      temp1 += (abs(a[i] - 2 * i));
      temp2 += (abs(a[i] - 2 * i + 1));
    }
    cout << min(temp1, temp2);
  }
}
