#include<bits/stdc++.h>
using namespace std;

int main(){
  int m;
  int n,a,cnt;
  m =0 , n=0, a=0, cnt =0;
  while(1){
    cin >> m;
    if(m == 0) break;
    cin >> n;
 
    for(int i=m;i<=n;i++){
      a = i;
      
      while(a % 2 ==0) a = a / 2;
      while(a % 3 ==0) a = a / 3;
      while(a % 5 ==0) a = a / 5;

      if(a == 1) cnt++;
    }


    cout << cnt << endl;
    cnt =0;

  }



}

