#include<iostream>

using namespace std;

int judge(int x){
  int tmp = 0;

  while(x != 1){
    if(x % 2 == 0) x /= 2;
    if(x % 3 == 0) x /= 3;
    if(x % 5 == 0) x /= 5;
    if(tmp == x) return 0;
    tmp = x;
  }
  return 1;
}

int main(){

  int fir, end;

  while(cin >> fir >> end){
    int sum = 0;
    for(int i = fir; i <= end; i++){
      if(judge(i)) sum++;
    }

    cout << sum << endl;
  }

  return 0;
}