#include <bits/stdc++.h>
using namespace std;
const long long inf = 4e18;
const long long maxn = 300;
const long long mod = 1e9 + 7;
#pragma GCC Optimize("Ofast")
long long a[maxn];
int main() {
  long long n;
  cin >> n;
  long long N = (n / 2);
  for (long long i = 0; i < N; i++) cin >> a[i];
  sort(a, a + N);
  long long Ans1 = 0, Ans2 = 0;
  for (long long i = 0; i < N; i++) Ans1 += abs(a[i] - ((2 * i) + 1));
  for (long long i = 0; i < N; i++) Ans2 += abs(a[i] - ((2 * i) + 2));
  cout << min(Ans1, Ans2);
}
