/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n/2];
		for(int i=0; i<n/2; i++)
		arr[i] = sc.nextInt();
		Arrays.sort(arr);
		int s1=0, s2=0, count=0;
		for(int i=1; i<=n; i+=2)
		s1+=Math.abs(arr[count++]-i);
		count=0;
		for(int i=2; i<=n; i+=2)
		s2+=Math.abs(arr[count++]-i);
		System.out.println(Math.min(s1,s2));
	}
}
