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