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