#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a;
  cin >> a;
  int ans = 0;
  long long b;
  cin >> b;
  for (long long x = 4; x <= 2 * b; x = 2 * x)
    for (long long y = x / 4; y >= 1; y = y / 2)
      if (a <= x - y - 1 && x - 1 - y <= b) ans++;
  cout << ans << endl;
  return 0;
}
