import java.util.*;

/**
 * 
 */

/**
 * @author Rohan
 *
 */
public class HelloWorld {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc  = new Scanner(System.in);
		int g = sc.nextInt();
		List<Integer> list = new ArrayList<>();
		for(int i =0;i<g/2;i++)
		{
			list.add(sc.nextInt());
		}
		Collections.sort(list);
		int minStep =0, countStep = Integer.MAX_VALUE;
		for(int i =1;i<g;i+=2)
		{
			minStep += Math.abs(i-list.get(i/2));
		}
		if(minStep < countStep )
		{
			countStep = minStep;
		}
		minStep = 0;
		for(int i =2;i<=g;i+=2)
		{
			minStep += Math.abs(i-list.get((i-1)/2));
		}
		if(minStep < countStep )
		{
			countStep = minStep;
		}
		System.out.println(countStep);
		sc.close();
	}

}
