#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;

int main(){
   int h[1000001];
   int i,n,m;
   h[1]=1;
   for(i=2;i<=1000000;i*=2)h[i]=1;
   for(i=1;i<=1000000;i++){
       if(h[i]){
           for(int j=i*3;j<=1000000;j*=3){
               if(h[j]==0)h[j]=2;
           }
       }
   }
   for(i=1;i<=1000000;i++){
       if(h[i]){
           for(int j=i*5;j<=1000000;j*=5){
               if(h[j]==0)h[j]=3;
           }
       }
   }
   while(cin>>n>>m&&n){
       int count=0;
       for(i=n;i<=m;i++){
           if(h[i]) count++;
       }
       cout<<count<<endl;
   }
    return 0;
}
