import java.util.*;

public class Chess985A {
	public static void main(String[] args) {
		
	Scanner sc=new Scanner(System.in);
	int n,a,s1=0,s2=0;
	n=sc.nextInt();
	int i;
	for(i=1;i<=n/2;i++) {
		a=sc.nextInt();
		s1+=Math.abs(i*2-1-a);
		s2+=Math.abs(i*2-a);
	}
	System.out.println(Math.min(s1, s2));
	}
}
