#include <bits/stdc++.h>
using namespace std;
int n, ans, A[100 + 5];
int Calc() {
  int res = 0;
  for (int i = 1; i <= (n >> 1); i++) res += abs(A[i] - (i * 2 - 1));
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= (n >> 1); i++) scanf("%d", A + i);
  sort(A + 1, A + (n >> 1) + 1);
  ans = Calc();
  for (int i = 1; i <= (n >> 1); i++) A[i] = n - A[i] + 1;
  reverse(A + 1, A + (n >> 1) + 1);
  ans = min(ans, Calc());
  printf("%d\n", ans);
  return 0;
}
