/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;
public class GFG {
	public static void main (String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int x=n/2;
		int [] a=new int[x];
		for(int i=0;i<x;i++) a[i]=sc.nextInt();
		int sum=0;
		for(int i=0;i<x;i++){
		    int y=((i+1)*2)-1;
		    sum=sum+ Math.abs(a[i]-y);
		}
		System.out.println(sum);
	}
}