#include <bits/stdc++.h>
using namespace std;
bool compare(pair<long long, long long> a, pair<long long, long long> b) {
  return (a.second < b.second);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int tests = 1;
  while (tests--) {
    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 e = 0, o = 0;
    long long k = 1;
    for (long long i = 0; i < n / 2; i++) {
      o += abs(k - a[i]);
      k += 2;
    }
    k = 2;
    for (long long i = 0; i < n / 2; i++) {
      e += abs(k - a[i]);
      k += 2;
    }
    cout << min(e, o);
  }
  return 0;
}
