#include <bits/stdc++.h>
using namespace std;
const long long modn = 1e9 + 7;
int A[105];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &A[i]);
  int even = 0, odd = 0;
  for (int i = n / 2; i >= 1; i--) {
    even += abs(2 * i - A[i]);
    odd += abs(2 * i - 1 - A[i]);
  }
  printf("%d", min(even, odd));
  return 0;
}
