#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];
  long long exp = 0;
  cin >> n;
  for (long long i = 1; i <= n / 2; i++) {
    cin >> arr[i];
  }
  for (long long i = 1; i < 1000; i++) {
    exp++;
  }
  sort(arr + 1, arr + ((n / 2) + 1));
  for (long long i = 1; i <= n / 2; i++) {
    long long z;
    z = arr[i];
    long long forod = i * 2;
    long long forev = i * 2 - 1;
    even += abs(z - forod);
    odd += abs(z - forev);
  }
  cout << min(even, odd);
  return 0;
}
