#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[101], id = 0;
  cin >> n;
  int t = 1, ans = 0;
  int k = 2, ans2 = 0;
  for (int i = 1; i <= n / 2; i++) {
    cin >> a[++id];
  }
  sort(a + 1, a + id + 1);
  for (int i = 1; i <= id; i++) {
    ans2 += fabs(k - a[i]);
    k += 2;
  }
  for (int i = 1; i <= id; i++) {
    ans += fabs(t - a[i]);
    t += 2;
  }
  cout << min(ans, ans2);
}
