function Main(input) {
    var input = input.split('\n').map(n => parseInt(n, 10));
    var r = input[0];
    var g = input[1];
    var p = (2 * g) - r
    console.log(p);
    }
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));