#include <bits/stdc++.h>
using namespace std;
int a[4000];
int main() {
  int n, ans1 = 0, ans2 = 0;
  cin >> n;
  for (int i = 1; i <= n / 2; ++i) cin >> a[i];
  sort(a + 1, a + 1 + n / 2);
  for (int i = 1; i <= n / 2; ++i) {
    ans1 += abs((i * 2 - 1) - a[i]);
    ans2 += abs((i * 2) - a[i]);
  }
  cout << min(ans1, ans2) << endl;
  return 0;
}
