import scala.collection.mutable
import scala.io.StdIn
import java.util._
import util.control.Breaks._

object Main extends App {
  val l = StdIn.readLine().split(" ").map(_.toInt)

  println(Math.max(0, l(0) - l(1)*2))
}