#include <bits/stdc++.h>
using namespace std;
int a[55];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n / 2; i++) scanf("%d", &a[i]);
  sort(a, a + n / 2);
  int res1 = 0;
  int res2 = 0;
  for (int i = 0; i < n / 2; i++) {
    res1 += abs(i * 2 + 1 - a[i]);
    res2 += abs(i * 2 + 2 - a[i]);
  }
  printf("%d\n", min(res1, res2));
}
