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

public class Main 
{
	public static void main(String[] args) 
	{
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		n = n/2;
		int[] arr = new int[n];
		for(int i=0; i<arr.length; i++)
			arr[i] = sc.nextInt();
		
		Arrays.sort(arr);
		
		long sum1 = 0, m = 2;
		for(int i=0; i < arr.length; i++)
		{
			sum1 += (long)Math.abs(arr[i] - m);
			m += 2;
		}
		
		long sum2 = 0, k = 1;
		for(int i=0; i < arr.length; i++)
		{
			sum2 += (long)Math.abs(arr[i] - k);
			k += 2;
		}
		
		System.out.println((long)Math.min(sum1, sum2));
		
	}
	
	
}

/*a


93 54 57 61 68 66 70 96 64 82 80 75 69 77 76 94 67 86 90 73 74 58 100 83 92 
89 56 99 88 59 95 72 81 51 85 71 97 60 91 63 65 98 79 84 53 62 87 55 52 78


*/