#include <bits/stdc++.h>
using namespace std;
const int N = 105, inf = 0x3f3f3f3f;
int p[N], n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n >> 1; ++i) scanf("%d", p + i);
  int ans = inf, cur = 0;
  for (int i = 1; i <= n >> 1; ++i) cur += abs(p[i] - (2 * i));
  ans = min(ans, cur);
  cur = 0;
  for (int i = 1; i <= n >> 1; ++i) cur += abs(p[i] - (2 * i - 1));
  ans = min(ans, cur);
  printf("%d\n", ans);
}
