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