#include <bits/stdc++.h>
using namespace std;
int N, arr[105];
bool used[105];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> N;
  for (int i = 0; i < N / 2; i++) cin >> arr[i];
  int sol1 = 0, id, l, sol2 = 0, p;
  for (int i = 1; i <= N; i += 2) {
    id = -1, l = 1 << 30;
    for (int j = 0; j < N / 2; j++) {
      p = arr[j];
      if (!used[j]) {
        if (abs(i - p) < l) {
          id = j;
          l = abs(i - p);
        }
      }
    }
    used[id] = true;
    sol1 += l;
  }
  memset(used, 0, N);
  for (int i = 2; i <= N; i += 2) {
    id = -1, l = 1 << 30;
    for (int j = 0; j < N / 2; j++) {
      p = arr[j];
      if (!used[j]) {
        if (abs(i - p) < l) {
          id = j;
          l = abs(i - p);
        }
      }
    }
    used[id] = true;
    sol2 += l;
  }
  cout << min(sol1, sol2) << '\n';
  return 0;
}
