#include <bits/stdc++.h>
using namespace std;
const int N = 300 * 1005;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  n /= 2;
  vector<int> a(n);
  int ans = 1e9;
  int s1 = 0, s2 = 0;
  int d1 = 1, d2 = 2;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < n; ++i) {
    s1 += abs(a[i] - d1);
    s2 += abs(a[i] - d2);
    d1 += 2;
    d2 += 2;
  }
  cout << min(s1, s2) << endl;
  return 0;
}
