n = gets.split(" ").map{|k| k.to_i }
until n[0] == 0
    start = n[0]
    finish = n[1]
    count = 0
    arry = (start..finish).to_a
    arry.each do |k|
        if (60**60) % k == 0
            count += 1
        elsif k == 1
            count += 1
        end
    end
    puts count
    n = gets.split(" ").map{|k| k.to_i }
end
