import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner reader = new Scanner(System.in);
        int n = reader.nextInt();
        int[] s = new int[n / 2];
        for(int i = 0; i < n / 2; i++){
            s[i] = reader.nextInt();
        }
        int ans = 0, tmp = 0;
        for(int i = n / 2 - 1; i >= 0; i--){
            if(n - (n - 2 * (i + 1)) > s[i])
                ans += n - (n - 2 * (i + 1)) - s[i];
            else
                ans -= n - (n - 2 * (i + 1)) - s[i];
        }
        for(int i = n / 2 - 1; i >= 0; i--){
            if(n - (n - 2 * (i + 1)) > s[i] + 1)
                tmp += n - (n - 2 * (i + 1)) - s[i] - 1;
            else
                tmp -= n - (n - 2 * (i + 1)) -s[i] - 1;
        }
        if(tmp > ans)
            System.out.println(ans);
        else
            System.out.println(tmp);

    }
}
