#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, res = INT_MAX, tmp = 0;
  cin >> n;
  n /= 2;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    tmp += abs(i * 2 + 2 - a[i]);
  }
  res = tmp;
  tmp = 0;
  for (int i = 0; i < n; i++) {
    tmp += abs(i * 2 + 1 - a[i]);
  }
  res = min(res, tmp);
  cout << res;
  return 0;
}
