// AtCoder My Practice
// author: Leonardone @ NEETSDKASU

[<EntryPoint>]
let main _ =
    let r = stdin.ReadLine() |> int
    let g = stdin.ReadLine() |> int
    let ans = 2 * g - r
    printfn "%d" ans
    0