#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 20;
const int MOD = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<int> a;
  for (int i = 0; i < (n / 2); i++) {
    int b;
    cin >> b;
    a.push_back(b);
  }
  sort(a.begin(), a.end());
  int sum = 0;
  int x = 1;
  for (int i = 0; i < (n / 2); i++) {
    sum += abs(a[i] - x);
    x += 2;
  }
  int sum1 = 0;
  x = 2;
  for (int i = 0; i < (n / 2); i++) {
    sum1 += abs(a[i] - x);
    x += 2;
  }
  cout << min(sum, sum1) << endl;
  return 0;
}
