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