#include <bits/stdc++.h>
using namespace std;
using lli = int64_t;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int T = 1;
  vector<int64_t> nums, nums2, factors;
  for (int64_t i = 0; i <= 30; i++) {
    nums.push_back(pow(2, i));
  }
  for (int64_t i = 0; i <= 19; i++) {
    nums2.push_back(pow(3, i));
  }
  for (int i = 0; i < (int)nums.size(); i++) {
    for (int j = 0; j < (int)nums2.size(); j++) {
      factors.push_back(nums[i] * nums2[j]);
    }
  }
  for (int t = 1; t <= T; t++) {
    int64_t l, r;
    cin >> l >> r;
    int count = 0;
    for (int i = 0; i < (int)factors.size(); i++) {
      if (factors[i] >= l and factors[i] <= r) {
        count += 1;
      }
    }
    cout << count;
  }
}
