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