#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e4 + 4;
const int INF = INT_MAX;
const int ONF = INT_MIN;
int main() {
  int n;
  cin >> n;
  int a[maxn];
  memset(a, 0, sizeof(a));
  for (int i = 1; i <= n / 2; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n / 2 + 1);
  int sum1 = 0, sum2 = 0;
  for (int i = 1; i <= n / 2; i++) {
    int x = a[i];
    sum1 += abs(2 * i - 1 - x);
    sum2 += abs(2 * i - x);
  }
  int minn = min(sum1, sum2);
  cout << minn << endl;
  return 0;
}
