def main()
  line = gets.split(' ')

  window_width = line[0].to_i
  cartain_width = line[1].to_i

  return if not window_width > 0 && window_width <= 100
  return if not cartain_width > 0 && cartain_width <= 100

  # return "window_widthが不正なレンジ: #{window_width}" if not window_width > 0 && window_width <= 100
  # return "cartain_widthが不正なレンジ: #{cartain_width}" if not cartain_width > 0 && cartain_width <= 100

  isnot_covered_catains_width = window_width - cartain_width * 2 > 0 
  isnot_covered_catains_width > 0 ? isnot_covered_catains_width : 0
  
end

p main
