#include <bits/stdc++.h>
using namespace std;
int chessboard(int N, vector<int> &vec) {
  int wsum = 0;
  int bsum = 0;
  int w = N;
  int b = N - 1;
  sort(vec.begin(), vec.end());
  for (int i = (N / 2) - 1; i > 0; --i) {
    wsum += abs(w - vec[i]);
    w -= 2;
  }
  for (int j = (N / 2) - 1; j > 0; --j) {
    bsum += abs(b - vec[j]);
    b -= 2;
  }
  return wsum < bsum ? wsum : bsum;
}
int main() {
  int n;
  vector<int> vec;
  cin >> n;
  for (int i = 0; i < n / 2; ++i) {
    int t;
    cin >> t;
    vec.push_back(t);
  }
  cout << "answer=" << chessboard(n, vec) << endl;
  return 0;
}
