import Foundation
 
let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ")
 
var A = Int(split[0])!
var B = Int(split[1])!

if (A>2*B){
    print(A-2*B)
}else{
    print(0)
}
