import java.io.BufferedReader
import java.io.InputStreamReader

fun main(args: Array<String>) {
    val br = BufferedReader(InputStreamReader(System.`in`))
    val r = br.readLine().toInt()
    val g = br.readLine().toInt()
    println(g*2 - r)
}
