object Main extends App {
    val input = scala.io.StdIn.readLine.split(" ").map(_.toInt).toSeq
    val A = input(0)
    val B = input(1)

    val answer = A - B * 2 match {
      case n if n < 0 => 0
      case n => n
    }

    println(answer)
}