#include <bits/stdc++.h>
using namespace std;
int n, cnte = 0, cnto = 0;
int a[107];
int move(int n) {
  int ans1 = 0, ans2 = 0;
  for (int i = 1; i <= n / 2; i++) {
    ans1 += abs(a[i] - (i << 1));
  }
  return ans1 < ans2 ? ans1 : ans2;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n / 2; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + n / 2 + 1);
  printf("%d\n", move(n));
  return 0;
}
