"use strict";
const Main = (input) =>{
   let xs = input.trim().split('\n');
   let R = Number(xs[0]);
   let G = Number(xs[1])*2;
   console.log(G-R);
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));


