import java.util.Arrays;
import java.util.Scanner;

public class Chess {
	public static void main(String[] args)
	{
		Scanner file = new Scanner(System.in);
		int n = file.nextInt(); file.nextLine();
		int[] arr = Arrays.stream(file.nextLine().split(" ")).mapToInt(x -> Integer.parseInt(x)).toArray();
		Arrays.sort(arr);
		
		int odd = 0, even = 0;
		for(int i = 0; i < n/2; i++)
		{
			even += Math.abs(arr[i]-(i*2+2));
			odd += Math.abs(arr[i]-(i*2+1));
		}
		System.out.println(Math.min(even, odd));
	}
}
