#include <bits/stdc++.h>
using namespace std;
using namespace std;
vector<long long> a;
long long ans1 = 0, ans2 = 0, n;
map<long long, long long> mp1;
map<long long, long long> mp2;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  a.resize(n / 2);
  for (long long i = 0; i < n / 2; i++) {
    cin >> a[i];
    mp1[a[i]] = 1;
    mp2[a[i]] = 1;
  }
  long long q = 1, z = 2;
  sort(a.begin(), a.end());
  for (long long i = 0; i < n / 2; i++) {
    ans1 += abs(a[i] - q);
    ans2 += abs(a[i] - z);
    q += 2;
    z += 2;
  }
  cout << min(ans1, ans2);
  return 0;
}
