#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 10;
int a[N];
int n, w, b;
int main() {
  cin >> n;
  for (int i = 1; i <= (n / 2); i++) {
    cin >> a[i];
  }
  int x = n / 2;
  sort(a + 1, a + x + 1);
  for (int i = 1; i <= (n / 2); i++) {
    w += abs(a[i] - (i * 2 - 1));
    b += abs(a[i] - (i * 2));
  }
  cout << min(b, w);
}
