#include <iostream>
using namespace std;

bool div(int a){
    
    if(a == 1){
        return true;
    }else if(a % 2 == 0){
        return div(a/2);
    }else if(a % 3 == 0){
        return div(a/3);
    }else if(a % 5 == 0){
        return div(a/5);
    }else{
        return false;
    }
    
}

int main(int argc, const char * argv[]) {

    
    
    while(true){
        int m;
        cin >> m;
        if(m==0){
            break;
        }
        
        int n;
        cin >> n;
        
        int count = 0;
        for(int i=m;i<=n;i++){
            if(div(i)){
                count++;
            }
        }
        
        cout << count << endl;
    }
    

    
    return 0;
}