loop do
    m, n = gets.split.map &:to_i
    break if m == 0

    count = 0
    x = 1
    loop do
        y = x
        loop do
            z = y
            loop do
                count += 1if z >= m
                z *= 5
                break if z > n
            end
            y *= 3
            break if y > n
        end
        x *= 2
        break if x > n
    end
    
    p count
end