#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p[500];
  queue<int> q1, q2;
  cin >> n;
  for (int i = 0; i < n / 2; ++i) cin >> p[i];
  sort(p, p + n / 2);
  for (int i = 0; i < n / 2; ++i) {
    q1.push(p[i]), q2.push(p[i]);
  }
  int mov1 = 0, mov2 = 0;
  for (int i = 1; i <= n; i += 2) {
    int cn = q1.front();
    q1.pop();
    mov1 += abs(i - cn);
  }
  for (int i = 2; i <= n; i += 2) {
    int cn = q2.front();
    q2.pop();
    mov2 += abs(i - cn);
  }
  cout << min(mov1, mov2);
  return 0;
}
