#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int a[100 + 5];
int main(int argc, char const *argv[]) {
  std::ios::sync_with_stdio(false);
  memset(a, 0, sizeof(a));
  int n;
  cin >> n;
  int sum1 = 0;
  int sum2 = 0;
  for (int i = 1; i <= n / 2; i++) cin >> a[i];
  sort(a + 1, a + 1 + n / 2);
  int m = 1, j = 2;
  for (int i = 1; i <= n / 2; i++) {
    sum1 = sum1 + abs(a[i] - m);
    m += 2;
    sum2 = sum2 + abs(a[i] - j);
    j += 2;
  }
  int ans = min(sum1, sum2);
  cout << ans;
  return 0;
}
