#include <bits/stdc++.h>
using namespace std;
int odd[50];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, i, j, ans = 0, x;
  for (i = 0, j = 1; i < 50, j < 100; i++, j += 2) odd[i] = j;
  cin >> n;
  x = n / 2;
  int a[x];
  for (i = 0; i < x; i++) cin >> a[i];
  sort(a, a + n);
  for (i = 0; i < x; i++) {
    ans += abs(a[i] - odd[i]);
  }
  cout << ans;
}
