#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 + 1, a + n / 2 + 1);
  long long p = n / 2;
  long long x = 0, y = 0;
  for (long long i = n - 1; i >= 1; i -= 2) {
    x += abs(i - a[p]);
    p--;
  }
  p = n / 2;
  for (long long i = n; i >= 2; i -= 2) {
    y += abs(i - a[p]);
    p--;
  }
  long long fin = min(x, y);
  cout << fin << "\n";
}
