#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, p[110], i, j, k, in = 1, l, sum = 0, sum1 = 0, ans, s;
  cin >> n;
  s = (n / 2);
  for (i = 1; i <= s; i++) {
    cin >> p[i];
  }
  sort(p, p + s);
  for (j = 1; j < n; j = j + 2) {
    sum += abs(j - p[in]);
    in++;
  }
  l = n / 2;
  for (j = n; j >= 2; j = j - 2) {
    sum1 += abs(j - p[l]);
    l--;
  }
  ans = min(sum, sum1);
  cout << ans << endl;
  return 0;
}
