#include <bits/stdc++.h>
using namespace std;
const int Inf = (int)1e9;
const long long InfL = (long long)1e18;
const int MaxN = (int)1e2 + 5;
pair<int, int> ans;
int a[MaxN];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  for (int i = 0; i < n / 2; i++) cin >> a[i];
  sort(a, a + n / 2);
  for (int i = n - 1; i >= 0; i -= 2) ans.first += abs(i + 1 - a[i / 2]);
  for (int i = n - 2; i >= 0; i -= 2) ans.second += abs(i + 1 - a[i / 2]);
  cout << min(ans.first, ans.second) << '\n';
  return 0;
}
