#include <bits/stdc++.h>
using namespace std;
using LL = long long;
int main() {
  int N;
  cin >> N;
  int a = 0, b = 0;
  vector<int> tab(N / 2);
  for (int i = 0; i < N / 2; ++i) {
    int x;
    cin >> tab[i];
  }
  sort(tab.begin(), tab.end());
  for (int i = 0; i < N / 2; ++i) {
    a += abs((2 * i + 1) - tab[i]);
    b += abs((2 * i + 2) - tab[i]);
  }
  cout << min(a, b);
}
