#include <bits/stdc++.h>
using namespace std;
long long n, a[105];
void solve() {
  cin >> n;
  for (long long i = 0; i < n / 2; i++) cin >> a[i];
  sort(a, a + n / 2);
  long long j = 0, x = 0, y = 0;
  for (long long i = 1; i <= n; i += 2) x += abs(i - a[j++]);
  j = 0;
  for (long long i = 2; i <= n; i += 2) y += abs(i - a[j++]);
  cout << min(x, y);
}
void prep() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  prep();
  cout << fixed << setprecision(12);
  while (t--) solve();
  return 0;
}
