#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 10;
const int mod = 1e9 + 7;
int N, M, Q, K;
int A[110];
int main() {
  int i, j, k;
  scanf("%d", &N);
  for (i = 1; i <= N / 2; ++i) {
    scanf("%d", &A[i]);
  }
  int cnt = 0;
  sort(A + 1, A + 1 + N / 2);
  int mini = 0x3f3f3f3f;
  for (i = 1; i <= N / 2; ++i) {
    cnt += abs(A[i] - (2 * i - 1));
  }
  mini = min(mini, cnt);
  cnt = 0;
  for (i = 1; i <= N / 2; ++i) {
    cnt += abs(A[i] - (2 * i));
  }
  mini = min(mini, cnt);
  printf("%d", mini);
}
