#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 5;
bool vis[maxn];
vector<int> v;
int solve(int s) {
  int ans = 0;
  for (int i = 0; i < v.size(); i++) {
    ans += abs(v[i] - s);
    s += 2;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int p;
  for (int i = 0; i < n / 2; i++) {
    cin >> p;
    vis[p] = 1;
    v.push_back(p);
  }
  sort(v.begin(), v.end());
  int cnt = min(solve(1), solve(2));
  cout << cnt << endl;
  return 0;
}
