#include <bits/stdc++.h>
using namespace std;
long long c[200006];
vector<pair<long long, long long>> sum;
long long pre[200006];
long long a[200006];
vector<long long> ans;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  for (long long i = 1; i <= n / 2; i++) cin >> a[i];
  sort(a, a + n / 2);
  long long countodd = 0;
  long long counteven = 0;
  long long min1 = 0;
  long long z = 1;
  for (long long i = 1; i <= n; i += 2) {
    min1 += abs(a[z] - i);
    z++;
  }
  long long min2 = 0;
  z = 1;
  for (long long i = 2; i <= n; i += 2) {
    min2 += abs(a[z] - i);
    z++;
  }
  long long ans = min(min1, min2);
  cout << ans << "\n";
}
