import java.util.*;

public class chess {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		ArrayList<Integer> a=new ArrayList<Integer>();
		for(int i=0;i<n/2;i++){
			int t=sc.nextInt();
			a.add(t);
		}
		Collections.sort(a);
		int ans1=0;
		int ans2=0;
		int x=n;
		for(int i=n/2-1;i>=0;i--){
			ans1+=Math.abs(x-a.get(i));
			ans2+=Math.abs(x-1-a.get(i));
			x=x-2;
		}
		System.out.println(Math.min(ans1, ans2));

	}

}
