two = Array.new
21.times do |i|
  two << 2 ** i
end

three = Array.new
14.times do |i|
  three << 3 ** i
end

five = Array.new
10.times do |i|
  five << 5 ** i
end

result = Array.new
two.each do |a|
  three.each do |b|
    five.each do |c|
      result << a * b * c
    end
  end
end

while input = $stdin.gets do
  m, n = input.chomp.split(" ").map(&:to_i)
  break if m == 0
  p result.select{|i| m <= i && i <= n}.size
end