#include <bits/stdc++.h>
const int MOD = 1e9 + 7;
const int N = 1e5 + 3;
using namespace std;
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
inline void set_bit(int& n, int b) { n |= (1ll << (b)); }
inline void unset_bit(int& n, int b) { n &= ~(1ll << (b)); }
int main() {
  long long a, b;
  cin >> a >> b;
  long long POWER[70];
  POWER[0] = 1;
  long long ans = 0;
  for (int i = 1; i <= 62; i++) POWER[i] = POWER[i - 1] << 1;
  set<long long> s;
  for (int i = 1; i < 63; i++) {
    for (int j = 0; j < i - 1; j++)
      if (POWER[i] - 1 - POWER[j] >= a && POWER[i] - 1 - POWER[j] <= b &&
          POWER[i] - 1 - POWER[j] != 1 &&
          s.find(POWER[i] - 1 - POWER[j]) == s.end())
        ans++, s.insert(POWER[i] - 1 - POWER[j]);
  }
  cout << ans << endl;
  return 0;
}
