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