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