#include <bits/stdc++.h>
using namespace std;
int a[1005];
int main() {
  int n;
  cin >> n;
  int sum = 0;
  int sum2 = 0;
  int ans = 0;
  for (int i = 0; i < n / 2; i++) {
    cin >> a[i];
  }
  sort(a, a + n / 2);
  int num = 2;
  for (int i = 0; i < n / 2; i++) {
    sum += abs(num - a[i]);
    num += 2;
  }
  ans = sum;
  num = 1;
  for (int i = 0; i < n / 2; i++) {
    sum2 += abs(num - a[i]);
    num += 2;
  }
  ans = min(ans, sum2);
  cout << ans << endl;
  return 0;
}
