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