#include<iostream>
using namespace std;

int main()
{
    int m, n;

    while( cin >> m )
    {
        if( m == 0 )
            break;
        
        cin >> n;
        
        int cnt = 0;

        for( int i = m; i <= n; i++ )
        {
            int j = i;
            while( j % 2 == 0 )
                j /= 2;
            while( j % 3 == 0 )
                j /= 3;
            while( j % 5 == 0 )
                j /= 5;
            if( j == 1 )
                cnt++;
        }
        cout << cnt << endl;
    }
    return 0;
}

