#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int a[n / 2];
  for (long long int i = 0; i < n / 2; i++) cin >> a[i];
  sort(a, a + n / 2);
  long long int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < n / 2; i++) {
    cnt1 += abs(a[i] - (2 * i + 1));
    cnt2 += abs(a[i] - (2 * i + 2));
  }
  cout << min(cnt1, cnt2);
}
