#include <bits/stdc++.h>
using namespace std;
int b[100], i, j, k, n, a[100];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (i = 1; i <= n / 2; i++) {
    cin >> a[i];
  }
  for (i = 1; i <= n; i++) {
    b[i] = i;
  }
  int s1 = 0, s2 = 0;
  for (i = 1, j = 1; i <= n, j <= n / 2; i += 2, j++) {
    s1 += fabs(a[j] - b[i]);
  }
  for (i = 2, j = 1; i <= n, j <= n / 2; i += 2, j++) {
    s2 += fabs(a[j] - b[i]);
  }
  cout << min(s1, s2);
}
