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