#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 1e3 + 7;
const int mod = 1e9;
int a[maxn];
int b[maxn];
int j[maxn], o[maxn];
int main() {
  int n;
  cin >> n;
  int cnt1 = 0, cnt2 = 0;
  for (int i = 1; i <= n / 2; i++) {
    cin >> a[i];
  }
  sort(a, a + n / 2);
  int ans1 = 0, ans2 = 0;
  for (int i = 1; i <= n / 2; i++) {
    ans1 += abs(2 * i - 1 - a[i]);
    ans2 += abs(2 * i - a[i]);
  }
  cout << min(ans1, ans2);
  return 0;
}
