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