#include <bits/stdc++.h>
using namespace std;
int main() {
  int N = 0, total1 = 0, total2 = 0;
  int tmp;
  scanf("%d", &N);
  vector<int> AAA(N / 2, 0);
  for (int i = 0; i < N / 2; i++) {
    scanf("%d", &tmp);
    AAA[i] = tmp;
  }
  sort(AAA.begin(), AAA.end());
  for (int i = 0; i < N / 2; i++) {
    total1 += abs(AAA[i] - i * 2 - 1);
    total2 += abs(AAA[i] - i * 2 - 2);
  }
  printf("%d", (total1 < total2) ? total1 : total2);
  return 0;
}
