import java.util.Scanner;

public class chess {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int[] chessboard = new int[n];
		for (int i = 0; i < n / 2; i++)
			chessboard[i] = scan.nextInt();
		int sum = 0, j = 0;
		for (int i = n / 2 - 1; i >= 0; i--) {
			sum = sum + Math.abs((n - (2 * j + 1) - chessboard[i]));
			j++;
		}
		System.out.println(sum);
		scan.close();
	}

}