require 'pp'

def gets; ARGF.gets; end

class Solver

  def initialize
  end

  def main
    a, b = gets.chomp.split.map(&:to_i)

    ans = a - b * 2
    ans = 0 if ans < 0
    puts ans
  end
end

if __FILE__ == $0
  Solver.new.main
end
