#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 10;
int a[maxn], even[maxn], odd[maxn];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i += 2) odd[i / 2 + 1] = i;
  for (int i = 2; i <= n; i += 2) even[i / 2] = i;
  for (int i = 1; i <= n / 2; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n / 2 + 1);
  int maxx = 0, maxp = 0;
  for (int i = 1; i <= n / 2; i++) {
    maxx += abs(a[i] - odd[i]);
    maxp += abs(a[i] - even[i]);
  }
  printf("%d\n", min(maxp, maxx));
  return 0;
}
