#include <bits/stdc++.h>
using namespace std;
int main(void){
    int m,n;
    while (cin>>m>>n) {
        if (m==0) {
            break;
        } else {
            int count=0;
            for (int i=m;i<=n;i++) {
                int tmp=i;
                if (tmp%2==0) {
                    while (tmp%2==0) {
                        tmp=tmp/2;
                    }
                    while (tmp%3==0) {
                        tmp=tmp/3;
                    }
                    while (tmp%5==0) {
                        tmp=tmp/5;
                    }
                    if (tmp==1) {
                        count++;
                    }
                } else {
                    while (tmp%3==0) {
                        tmp=tmp/3;
                    }
                    while (tmp%5==0) {
                        tmp=tmp/5;
                    }
                    if (tmp==1) {
                        count++;
                    }
                }
            }
            cout<<count<<endl;
        }
    }
}
