#include <bits/stdc++.h>
int main(int argc, char *argv[]) {
  int N;
  std::cin >> N;
  std::vector<int> pos(N / 2);
  for (int i = 0; i < N / 2; ++i) std::cin >> pos[i];
  std::sort(pos.begin(), pos.end());
  int even = 0, odd = 0;
  for (int i = N / 2; i > 0; --i) {
    even += abs(i * 2 - pos[i - 1]);
    odd += abs(i * 2 - 1 - pos[i - 1]);
  }
  std::cout << std::min(even, odd);
  return 0;
}
