#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
int p[MAXN];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; 2 * i <= n; i++) scanf("%d", &p[i]);
  sort(p + 1, p + 1 + n / 2);
  int ans = 1e9, now = 0;
  int pos = n;
  for (int i = n / 2; i >= 1; i--) {
    now += abs(pos - p[i]);
    pos -= 2;
  }
  ans = min(ans, now);
  now = 0;
  pos = n - 1;
  for (int i = n / 2; i >= 1; i--) {
    now += abs(pos - p[i]);
    pos -= 2;
  }
  ans = min(ans, now);
  printf("%d\n", ans);
  return 0;
}
