#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 7;
int a[N];
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 + 1);
  int res = 1e9, sum = 0;
  for (int i = 1; i <= n / 2; ++i) sum += abs(i * 2 - 1 - a[i]);
  res = min(res, sum);
  sum = 0;
  for (int i = 1; i <= n / 2; ++i) sum += abs(i * 2 - a[i]);
  res = min(res, sum);
  printf("%d", res);
  return 0;
}
