#include<iostream>
using namespace std;
int main(){
    int n,m;
    while(cin >> n,n){
        cin >> m;
        int ans = 0;
        for(int i = n; i <= m; i++){
            int t = i;
            while(t % 2 == 0)t /= 2;
            while(t % 3 == 0)t /= 3;
            while(t % 5 == 0)t /= 5;
            if(t == 1)ans++;
        }
        cout << ans << endl;
    }
}

