#include <bits/stdc++.h>
using namespace std;
int main() {
  int board_size;
  int board[100], black_moves = 0, white_moves = 0, n = 1, m = 2, temp;
  cin >> board_size;
  for (int k = 0; k < board_size / 2; k++) {
    cin >> board[k];
  }
  for (int x = 0; x < board_size / 2; x++) {
    for (int y = 0; y < board_size / 2 - 1 - x; y++) {
      if (board[y] > board[y + 1]) {
        temp = board[y + 1];
        board[y + 1] = board[y];
        board[y] = temp;
      }
    }
  }
  for (int i = 0; i < board_size / 2; i++, n += 2, m += 2) {
    black_moves += abs(board[i] - n);
    white_moves += abs(board[i] - m);
  }
  if (white_moves < black_moves) {
    cout << white_moves;
  } else
    cout << black_moves;
  return 0;
}
