#include <cstdio>
using namespace std;

bool is_valid(int num) {
    while(num % 2 == 0) num /= 2;
    while(num % 3 == 0) num /= 3;
    while(num % 5 == 0) num /= 5;
    return num == 1;
}

int solve_testcase() {
    int L; scanf("%d", &L);
    if(L == 0) return 1;
    int R; scanf("%d", &R);

    int ans = 0;
    for(int i=L; i<=R; i++) ans += is_valid(i);
    printf("%d\n", ans);
    
    return 0;
}

int main() {
    while(!solve_testcase());
}

