#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
map<long long, long long> mp;
set<long long> s;
long long mn = INT_MAX, mx = INT_MIN;
long long i, j, tmp, sum, cn, ans, res;
int main() {
  long long n, x, odd = 1, even = 2, ans1 = 0, ans2 = 0;
  cin >> n;
  n /= 2;
  long long a[n + 2];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (i = 0; i < n; i++) {
    ans1 += abs(a[i] - odd);
    ans2 += abs(a[i] - even);
    odd += 2;
    even += 2;
  }
  cout << min(ans1, ans2);
  return 0;
}
