#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  vector<int> v;
  cin >> n;
  for (int i = 1; i <= n / 2; ++i) {
    int x;
    cin >> x;
    v.push_back(x);
  }
  sort(v.begin(), v.end());
  int s1 = 0, s2 = 0;
  for (int i = 0; i < n / 2; ++i) {
    s1 += abs(2 * i + 1 - v[i]);
    s2 += abs(2 * i + 2 - v[i]);
  }
  int ans = min(s1, s2);
  cout << ans;
  return 0;
}
