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

public class A985
{
	public static void main( String[] args )
	{
		Scanner in = new Scanner( System.in );
		int n = in.nextInt();
		int odd = 0, even = 0;
		// maybe number is not sorted
		int[] ary = new int[n / 2];
		for ( int i = 0; i < n / 2; i++ )
		{
			ary[i] = in.nextInt();
		}
		Arrays.sort( ary );
		for ( int i = 0; i < ary.length; i++ )
		{
			odd += Math.abs( ( i * 2 + 1 ) - ary[i] );
			even += Math.abs( ( i * 2 + 2 ) - ary[i] );
		}
		System.out.println( Math.min( odd, even ) );
	}
}
