#include <iostream>
#include <cstdio>
using namespace std;

int main(){
  int a,b;
  while(cin >> a,a ){
    cin >> b;
    int cnt = 0;
    for(int i = a ; i <= b ; i++ ){
      int c = i;
      while(c%2 == 0)c/=2;
      while(c%3 == 0)c/=3;
      while(c%5 == 0)c/=5;
      if(c==1)cnt++;
    }
    cout << cnt << endl;
  }
}