//package DC;

import java.awt.List;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Scanner;;

public class Main {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int boardSize = s.nextInt();
		ArrayList<Integer> positions = new ArrayList<>();
		for (int i = 0; i < boardSize / 2; i++)
			positions.add(s.nextInt());
		Collections.sort(positions);
		long numberOfMoves1 = 0, numberOfMoves2 = 0;
		int index = 0;
		for (int i = 2; i <= boardSize; i += 2) {
			numberOfMoves1 += Math.abs(positions.get(index) - i);
			index++;
		}
		index=0;
		for (int i = 1; i <= boardSize - 1; i += 2) {
			numberOfMoves2 += Math.abs(positions.get(index) - i);
			index++;
		}
		System.out.println(Math.min(numberOfMoves1, numberOfMoves2));

	}

}