#include <bits/stdc++.h>
using namespace std;
long long inv(long long a, long long b) {
  return (a > 1 ? b - inv(b % a, a) * b / a : 1);
}
const long double PI = 3.14159265359;
const long long inf = (1LL << 62);
const int iinf = (1 << 30);
int n, A, B, a[110];
int main() {
  cin >> n;
  for (int i = 1; i <= n / 2; i++) cin >> a[i];
  sort(a + 1, a + 1 + n / 2);
  for (int i = 1; i <= n / 2; i++) {
    A += abs(a[i] - (2 * i - 1));
    B += abs(a[i] - 2 * i);
  }
  cout << min(A, B);
  return 0;
}
