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