#include <bits/stdc++.h>
using namespace std;
int TEST, CASE = 1;
int n, a, b, m, c, ans = 0, total, k;
int arr[110] = {0};
int odd[110] = {0};
int even[110] = {0};
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  a = (n / 2);
  for (int i = 0; i < a; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + a);
  for (int i = 1; i <= n; i++) {
    odd[i] = arr[i];
  }
  for (int i = 1; i <= n; i++) {
    even[i] = arr[i];
  }
  ans = INT_MAX;
  c = 0;
  int i = 0, j = 1;
  while (i < a) {
    c += abs(j - arr[i]);
    i++;
    j += 2;
  }
  ans = min(c, ans);
  c = 0;
  i = 0, j = 2;
  while (i < a) {
    c += abs(j - arr[i]);
    i++;
    j += 2;
  }
  ans = min(c, ans);
  i = 0, j = n;
  while (i < a) {
    c += abs(j - arr[i]);
    i++, j -= 2;
  }
  ans = min(c, ans);
  c = 0;
  i = 0, j = n - 1;
  while (i < a) {
    c += abs(j - arr[i]);
    i++;
    j -= 2;
  }
  ans = min(c, ans);
  cout << ans << endl;
  return 0;
}
