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