#include <bits/stdc++.h>
using namespace std;
int arr[105];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n / 2; i++) cin >> arr[i];
  int count1 = 0;
  for (int i = n / 2; i >= 1; i--) {
    count1 = count1 + abs((i * 2) - arr[i]);
  }
  int count2 = 0;
  for (int i = n / 2; i >= 1; i--) {
    count2 = count2 + abs((i * 2 - 1) - arr[i]);
  }
  cout << min(count1, count2) << endl;
}
