def price(year, price)
  if year <= 5
    return 0
    exit
  elsif year <= 12
    return price / 2
    exit
  else
    return price
    exit
  end
end

a, b = gets.chomp.split.map(&:to_i)
puts price(a, b)
