function Main(input) {
	input = input.trim().split("\n").map((a)=>Number(a));
  var R = input[0];
  var G = input[1];
  console.log(2 * G - R);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));