#include <bits/stdc++.h>
using namespace std;
int n;
int a[100 + 5];
int main() {
  cin >> n;
  for (int i = 1; i <= n / 2; i++) scanf("%d", a + i);
  sort(a + 1, a + 1 + n);
  int ans = 0;
  for (int i = 1; i <= n / 2; i++) ans += std::abs(i * 2 - 1 - a[i]);
  int ans2 = 0;
  for (int i = 1; i <= n / 2; i++) ans2 += std::abs(i * 2 - a[i]);
  cout << min(ans, ans2) << endl;
  return 0;
}
