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

// Marcelino Galarza
// July 24th, 2018

public class aFast 
{

	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		int size = in.nextInt();
		int[] arr = new int[size/2];
		for (int i = 0; i < arr.length; i++)
			arr[i] = in.nextInt();
		
		Arrays.sort(arr);
		int oddCount = 0;
		int evenCount = 0;

		// 'i' is for the index for the 'arr' but subtract 1
		// i*2 is for the spot, either even or odd
		for (int i = 1; i <= size/2; i++)
		{
			oddCount += Math.abs(i*2-1 - arr[i-1]);
			evenCount += Math.abs(i*2 - arr[i-1]);
		}
		
		// So pretty much you're always going pick the smallest index and figure out how
		// many steps it takes to get there. You use the absolute value because it could 
		// be either on the left or right hand side of you spot you want filled. 
		
		System.out.println((oddCount < evenCount ? oddCount : evenCount));
	}
}
