#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int nax = 1000000 + 10;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int i, n;
  cin >> n;
  int a[n];
  for (i = 0; i < n / 2; i++) cin >> a[i];
  sort(a, a + n / 2);
  int ans = 1005;
  int k = n - 1, b = 0;
  for (i = n / 2 - 1; i >= 0; i--) {
    b += abs(a[i] - k);
    k -= 2;
  }
  ans = min(ans, b);
  k = n;
  for (i = n / 2 - 1; i >= 0; i--) {
    b += abs(a[i] - k);
    k -= 2;
  }
  ans = min(ans, b);
  cout << ans;
}
