#include <iostream>
using namespace std;

int main() {

  int n,m;

  while(1) {

    cin >> n;
    if(n == 0) break;

    cin >> m;
    int t;
    int count = 0;
    for(int i=n;i<=m;i++) {
      t = i;

      while(1) {
	//	cout << "t = " << t<< endl;
      if(t%2 == 0)t /= 2;
      else if(t%3 ==0)t /= 3;
      else if(t%5 ==0) t /= 5;
      else break;
      }

      if(t == 1) count++;
    }

    cout << count << endl;

  }

  return 0;

}