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