#include <bits/stdc++.h>
using namespace std;
int mod = 1000000007;
const double PI = 3.14159265;
int main() {
  long long a, b;
  cin >> a >> b;
  long long i = 1;
  int count = 0;
  int lowercount = 0;
  while (i <= b) {
    count++;
    if (i <= a) {
      lowercount++;
    }
    i = i << 1LL;
  }
  lowercount--;
  long long ans = 0;
  for (int j = count; j > lowercount; j--) {
    for (int k = 0; k < j - 1; k++) {
      i = (1LL << j) - 1 - (1LL << k);
      if (i <= b && i >= a) {
        ans++;
      }
    }
  }
  cout << ans;
}
