#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

vector<int> hamming;

void ham() {
  int temp;
  for(int i=0;i<21;i++) {
    for(int j=0;j<21;j++) {
      for(int k=0;k<21;k++) {
        temp = pow(2.0,(double)i)*pow(3.0,(double)j)*pow(5.0,(double)k);
        if(temp <= 1000000 && temp >= 0) {
        hamming.push_back(temp);
        }
        else {
          break;
        }
      }
    }
  }
}

int main() {
  int m,n,from,to;
  vector<int>::iterator low,up;
  ham();
  sort(hamming.begin(),hamming.end());
  while(cin >> m >> n) {
    low=lower_bound(hamming.begin(), hamming.end(), m);
    up=upper_bound(hamming.begin(),hamming.end(),n);
    from = int(low-hamming.begin());
    to = int(up-hamming.begin());
    cout << to-from << endl;
  }
}