#include <bits/stdc++.h>
using namespace std;
long long a[1000005];
int main(int argc, char const *argv[]) {
  long long n, ans = 0;
  cin >> n;
  n /= 2;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  long long x, y, t;
  x = y = 0;
  t = 1;
  for (int i = 1; i <= n; i++) {
    x += abs(t - a[i]);
    t += 2;
  }
  t = 2;
  for (int i = 1; i <= n; i++) {
    y += abs(t - a[i]);
    t += 2;
  }
  cout << min(x, y);
  return 0;
}
