#include <bits/stdc++.h>
using namespace std;
int main() {
  int in[105]{};
  int N, i;
  scanf("%d", &N);
  for (i = 1; i <= N / 2; i++) scanf("%d", &in[i]);
  sort(in + 1, in + N / 2 + 1);
  int s1 = 0, s2 = 0;
  for (i = 1; i <= N / 2; i++) {
    s1 += abs(in[i] - (2 * i - 1));
    s2 += abs(in[i] - 2 * i);
  }
  return !printf("%d\n", min(s1, s2));
}
