function main(input){
    var tmp = input.split(/\r\n|\r|\n/);
    var R = Number(tmp[0]);
    var G = Number(tmp[1]);

    console.log(G*2 - R);
}

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