#include <bits/stdc++.h>
using namespace std;
long long int pow1(long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % 1000000007;
    a = (a * a) % 1000000007;
    b = b >> 1;
  }
  return ans;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int a[n / 2];
  for (int i = 0; i < n / 2; i++) cin >> a[i];
  sort(a, a + n / 2);
  int sum1 = 0, sum2 = 0;
  int j = 0;
  for (int i = 1; i <= n; i += 2) {
    sum1 += abs(a[j] - i);
    sum2 += abs(a[j] - i - 1);
    j++;
  }
  cout << min(sum1, sum2);
  return 0;
}
