import java.util.Scanner
import java.io.PrintWriter

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val pw = new PrintWriter(System.out)

    val a, b = sc.nextInt()
    pw.println(math.max(a - 2 * b, 0))

    pw.flush()
  }
}