#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[105];
  int ans = 0;
  for (int i = 1; i <= n / 2; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n / 2 + 1, less<int>());
  int d = 1;
  for (int i = 1; i <= n / 2; i++) {
    ans += fabs(d - a[i]);
    d = d + 2;
  }
  int mun = 0;
  d = 2;
  for (int i = 1; i <= n / 2; i++) {
    mun += fabs(d - a[i]);
    d = d + 2;
  }
  int x = min(ans, mun);
  cout << x << endl;
}
