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