#include <cstdio>
using namespace std;
int main(void){
  int i,n,m,x,count;
  char str[1000001];
 
  for( ; ; ){
    fgets(str,sizeof(str),stdin);
    sscanf(str,"%d %d",&m,&n);
    if(m == 0) break;
    count = 0;
    for(i=m; i<=n; i++){
      x = i; 
      for( ; ; ){
        if(x == 1){
          count++;
          break;}
        else if(x%2 == 0){
          x /= 2;}
        else if(x%3 == 0){
          x /= 3;}
        else if(x%5 == 0){
          x /= 5;}
        else
          break;
      }
    }
    printf("%d\n", count);
  }
  return 0;
}