#include<bits/stdc++.h>

using namespace std;

int main()
{ 
  while(1)
  {
    int m,n;
    cin>>m;
    if(m == 0){
      break;
    }
    cin>>n;

    int ans = 0;

    for(int i = m;i <= n;++i){
      int temp = i;

      for(int j = temp;j > 1;){
        if(temp % 5 == 0){
          temp = temp / 5;
        }
        else if(temp % 3 == 0){
          temp = temp / 3;
        }
        else if(temp % 2 == 0){
          temp = temp / 2;
        }
        else{
          break;
        }
      }
      
      if(temp == 1){
        ++ans;
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}
