#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 = 1; i <= a; i++) {
    cin >> m;
    arr[m] = 1;
  }
  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;
  a = 0;
  for (int i = 1; i <= n; i += 2) {
    for (int j = 1; j <= n; j++) {
      if (odd[j] == 1) {
        a += abs(j - i);
        odd[j] = 0;
        break;
      }
    }
  }
  ans = min(a, ans);
  a = 0;
  for (int i = n; i >= 2; i -= 2) {
    for (int j = i; j >= 1; j--) {
      if (even[j] == 1) {
        a += abs(j - i);
        even[j] = 0;
        break;
      }
    }
  }
  ans = min(a, ans);
  cout << ans << endl;
  return 0;
}
