#include <bits/stdc++.h>
using namespace std;
int a[123456];
int main(void) {
  int num;
  scanf("%d", &num);
  for (int i = 0; i < num / 2; i++) scanf("%d", &a[i]);
  sort(a, a + (num / 2));
  int ans = 1e8;
  for (int i = 1; i <= num; i += 2) {
    int start = i;
    int res = 0;
    for (int j = 0; j < num / 2; j++) {
      if (start > num) {
        res += 1e8;
        break;
      }
      res += abs(a[j] - start);
      start += 2;
    }
    ans = min(ans, res);
  }
  for (int i = 2; i <= num; i += 2) {
    int start = i;
    int res = 0;
    for (int j = 0; j < num / 2; j++) {
      if (start > num) {
        res += 1e8;
        break;
      }
      res += abs(a[j] - start);
      start += 2;
    }
    ans = min(ans, res);
  }
  printf("%d\n", ans);
  return 0;
}
