#include <bits/stdc++.h>
using namespace std;
int a[101];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int n2 = n / 2;
  for (int i = 0; i < n2; i++) {
    cin >> a[i];
  }
  sort(a, a + n2);
  int start = 1;
  int ans = 0;
  for (int i = 0; i < n2; i++) {
    ans += abs(a[i] - start);
    start += 2;
  }
  int t = 0;
  start = 2;
  for (int i = 0; i < n2; i++) {
    t += abs(a[i] - start);
    start += 2;
  }
  cout << min(ans, t);
}
