#include <bits/stdc++.h>
int a[1000], n;
inline int abs(int x) { return x < 0 ? -x : x; }
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n / 2; i++) scanf("%d", &a[i]);
  std::sort(a, a + n / 2);
  int ans0 = 0;
  for (int i = 0, cur = 1; i < n / 2; i++) {
    ans0 += abs(a[i] - cur);
    cur += 2;
  }
  int ans1 = 0;
  for (int i = 0, cur = 2; i < n / 2; i++) {
    ans1 += abs(a[i] - cur);
    cur += 2;
  }
  printf("%d\n", std::min(ans1, ans0));
  return 0;
}
