#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  long long a[(n / 2)];
  for (long long i = 0; i < n / 2; i++) {
    cin >> a[i];
  }
  sort(a, a + n / 2);
  long long p = n, q = n - 1, r = 0, s = 0;
  for (long long i = (n / 2) - 1; i >= 0; i--) {
    r = r + abs(p - a[i]);
    s = s + abs(q - a[i]);
    p = p - 2;
    q = q - 2;
  }
  if (r > s) {
    cout << s;
  } else {
    cout << r;
  }
  return 0;
}
