#include <bits/stdc++.h>
using namespace std;
int N, a[55];
inline int rd() {
  int ret = 0, f_f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f_f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    ret = (ret << 1) + (ret << 3) + c - '0', c = getchar();
  return ret * f_f;
}
int main() {
  N = rd();
  for (int i = 1; i <= (N >> 1); i++) a[i] = rd();
  int ans1 = 0, ans2 = 0;
  for (int i = 1; i <= (N >> 1); i++) ans1 += abs(a[i] - i - i);
  for (int i = 1; i <= (N >> 1); i++) ans2 += abs(a[i] - i - i + 1);
  return printf("%d\n", ((ans1) < (ans2) ? (ans1) : (ans2))), 0;
}
