function Main(input) {
    input = input.split("\n");
    var R = parseInt(input[0], 10);
    var G = parseInt(input[1], 10);
    console.log(R*2-G);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));