#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int m = n / 2;
    int a[105], ans = 0, cnt = 0;
    for (int i = 1; i <= m; i++) cin >> a[i];
    sort(a + 1, a + n + 1);
    for (int i = 1, j = 1; i <= m; i++) {
      ans += abs(a[i] - j);
      j++;
      cnt += abs(a[i] - j);
      j++;
    }
    cout << min(ans, cnt) << endl;
  }
  return 0;
}
