func readInts() -> [Int] {
    return readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let ab = readInts()
    if ab[0] < ab[1] * 2 {
        print("0")
    } else {
        print(ab[0] - ab[1] * 2)
    }
}

main()
