#include <bits/stdc++.h>
using namespace std;
int n, tb[100], w1, w2, l = 1;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n / 2; i++) scanf("%d", &tb[i]);
  sort(tb, tb + n / 2);
  for (int i = 0; i < n / 2; i++) {
    w1 += abs(tb[i] - l);
    l += 2;
  }
  l = 2;
  for (int i = 0; i < n / 2; i++) {
    w2 += abs(tb[i] - l);
    l += 2;
  }
  printf("%d", min(w1, w2));
  return 0;
}
