#include <bits/stdc++.h>
using namespace std;
const int MAX = 200005;
const int mod = 1000000007;
int arr[MAX];
int main() {
  int n, x;
  scanf("%d", &n);
  int ans1 = 0, ans2 = 0, odd = 1, even = 2;
  n /= 2;
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  sort(arr, arr + n);
  for (int i = 0; i < n; i++) {
    x = arr[i];
    ans1 += abs(odd - x);
    ans2 += abs(even - x);
    odd += 2, even += 2;
  }
  printf("%d\n", min(ans1, ans2));
}
