#include <bits/stdc++.h>
#pragma GCC optimize(2)
const long long mod = 9973;
const int maxn = 1e6 + 5;
const int INF = 1e9 + 7;
using namespace std;
long long n, m;
int num[maxn];
int main() {
  scanf("%lld", &n);
  for (int i = 1; i <= n / 2; i++) scanf("%d", &num[i]);
  sort(num + 1, num + 1 + n / 2);
  int cot = 0, minl = INF;
  for (int i = 1; i <= n; i += 2) {
    if (num[i / 2 + 1] <= i)
      cot += i - num[i / 2 + 1];
    else
      cot += num[i / 2 + 1] - i;
  }
  minl = min(minl, cot);
  cot = 0;
  for (int i = 2; i <= n; i += 2) {
    if (num[i / 2] <= i)
      cot += i - num[i / 2];
    else
      cot += num[i / 2] - i;
  }
  minl = min(minl, cot);
  printf("%d\n", minl);
  return 0;
}
