#include <bits/stdc++.h>
using namespace std;
long long int arr[1234567];
int main() {
  long long int i, j, k, l, m, n, q, a, b;
  long long int x, y;
  long long int maximum = 1e18, itr = 1, ans;
  i = 4;
  maximum *= 2;
  while (i <= maximum) {
    j = i - 1;
    l = 1;
    k = i / 2;
    while (l < k) {
      arr[itr++] = j - l;
      l *= 2;
    }
    i *= 2;
  }
  sort(arr, arr + itr);
  cin >> a >> b;
  x = lower_bound(arr, arr + itr, a) - arr;
  y = lower_bound(arr, arr + itr, b) - arr;
  ans = y - x;
  if (*(arr + y) == b) ans++;
  cout << ans << endl;
}
