import java.util.*;
public class ChessPlacing {
	static int n; 
	static int[] val; 
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 
		n = sc.nextInt();
		val = new int[n];
		for (int i=0;i<n/2;i++) 
			val[i] =sc.nextInt();
		Arrays.sort(val, 0, n/2);;
		int ans =0  ; 
		int item = 1; 
		for ( int i=0;i<n/2; i++ ) {
			ans += Math.abs( val[i]-item ); 
			item +=2 ; 
		}
		
		
		int tans =0 ;
		item = 2; 
		for ( int i=0;i<n/2;i++ ) 
		{
			tans += Math.abs(val[i]-item); 
			item+=2; 
		}
		System.out.println( Math.min(tans, ans));
		sc.close();
	}
	
}
