#include <bits/stdc++.h>
using namespace std;
int n;
int a[1005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n / 2; i++) scanf("%d", &a[i]);
  sort(&a[1], &a[n / 2 + 1]);
  int ans1 = 0;
  for (int i = 1; i <= n / 2; i++) ans1 += abs(a[i] - (i * 2 - 1));
  int ans2 = 0;
  for (int i = 1; i <= n / 2; i++) ans1 += abs(a[i] - (i * 2));
  printf("%d", min(ans1, ans2));
}
