#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void cmax(int& x, const int& y) { x = x > y ? x : y; }
void cmin(int& x, const int& y) { x = x < y ? x : y; }
template <class T>
istream& operator>>(istream& in, vector<T>& V) {
  for (auto& x : V) in >> x;
  return in;
}
template <class T>
ostream& operator<<(ostream& out, const vector<T>& V) {
  for (auto x : V) out << x << ' ';
  return out;
}
template <class T>
void sort(vector<T>& V) {
  sort(V.begin(), V.end());
}
template <class T>
void reverse(vector<T>& V) {
  reverse(V.begin(), V.end());
}
template <class T>
int SZ(const vector<T>& V) {
  return (int)V.size();
}
void debug() { cerr << "whxorz" << '\n'; }
int p[101];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  int m;
  cin >> n;
  m = n / 2;
  int ans1 = 0;
  int ans2 = 0;
  for (int i = 1; i <= m; i++) {
    cin >> p[i];
  }
  sort(p + 1, p + m + 1);
  for (int i = 1; i <= m; i++) {
    ans1 += abs(i * 2 - 1 - p[i]);
    ans2 += abs(i * 2 - p[i]);
  }
  cout << min(ans1, ans2) << '\n';
  return 0;
}
