#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n;
  long long even = 0, odd = 0, arr[101];
  cin >> n;
  for (long long i = 1; i <= n / 2; i++) {
    cin >> arr[i];
  }
  sort(arr + 1, arr + (n / 2));
  for (long long i = 1; i <= n / 2; i++) {
    long long z;
    z = arr[i];
    even += abs(z - 2 * i);
    odd += abs(z - ((2 * i) - 1));
  }
  cout << min(even, odd);
  return 0;
}
