#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, i, j, k;
  cin >> n;
  int a[n / 2];
  for (i = 0; i < n / 2; i++) cin >> a[i];
  sort(a, a + n / 2);
  int count = 0;
  for (i = 1; i <= n; i += 2) count += abs(a[i / 2] - i);
  int even = 0;
  for (i = 2; i <= n; i += 2) even += abs(a[i / 2 - 1] - i);
  cout << min(count, even) << endl;
}
