#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 1e5 + 10;
const double eps = 1e-7;
const long long mod = 1e9 + 7;
int a[110];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n / 2; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + n / 2);
  int sum = 0;
  for (int i = n / 2, j = n - 1; i > 0; i--, j -= 2) {
    sum += abs(a[i] - j);
  }
  printf("%d\n", sum);
  return 0;
}
