#include <iostream>

using namespace std;

int cnt;

void dfs(int i)
{
    if (i == 1)
        cnt++;
    else if (i % 2 == 0)
        dfs(i / 2);
    else if (i % 3 == 0)
        dfs(i / 3);
    else if (i % 5 == 0)
        dfs(i / 5);
}

int main()
{
    int m, n;

    while (cin >> m, m) {
        cin >> n;
        
        cnt = 0;
        for (int i = m; i <= n; i++) 
            dfs(i);
        cout << cnt << endl;
    }

    return 0;
}