#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int k, i, n, t, ans, a[60], b[60], x;
  for (k = i = 1; i <= 50; i++) {
    a[i] = k++;
    b[i] = k++;
  }
  while (cin >> n) {
    for (t = 0, i = 1; i <= n / 2; i++) {
      cin >> x;
      t += fabs(a[i] - x);
      ans += fabs(b[i] - x);
    }
    ans = min(ans, t);
    cout << ans << endl;
  }
  return 0;
}
