import java.util.Arrays;
import java.util.Scanner;
public class A985{
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int num = scan.nextInt();
		int first = 0, second = 0, odd = 1, even = 2;
		int[] array = new int[num/2];
		for(int i = 0 ; i < num/2; i++)
			array[i] = scan.nextInt();
		Arrays.sort(array);
		for(int i = 0; i < num/2; i++){
			first += Math.abs(array[i] - odd);
			second += Math.abs(array[i] - even);
			odd += 2;
			even += 2;
		}
		System.out.println(first < second ? first : second);
	}
}