#include <iostream>

using namespace std;

int main()
{
  int n, m, a[1000000], p = 0, c, t;

  for(int i = 1; i <= 1000000; i++){
    t = i;
    while(t%5 == 0){
      t /= 5;
    }
    while(t%3 == 0){
      t /= 3;
    }
    while(t%2 == 0){
      t /= 2;
    }
    if(t == 1){
      a[p++] = i;
    }
  }

  while(1){
    cin >> m;
    if(m == 0){
      break;
    }
    cin >> n;
    c = 0;
    for(int i = 0; i < p && a[i] <= n; i++){
      if(m <= a[i]){
	c++;
      }
    }
    cout << c << endl;
  }

  return 0;
}