#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[101], res = 0, ans = 0, odd = 0, even = 0;
  cin >> n;
  for (int i = 1; i <= n / 2; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n / 2 + 1);
  for (int i = 1; i <= n / 2; i++) {
    for (int j = 1 + res; j <= n; j += 2) {
      res += 2;
      ans += abs(a[i] - j);
      break;
    }
  }
  res = 0;
  for (int i = 1; i <= n / 2; i++) {
    for (int j = 2 + res; j <= n; j += 2) {
      res += 2;
      even += abs(a[i] - j);
      break;
    }
  }
  cout << min(even, ans);
  return 0;
}
