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