#include <bits/stdc++.h>
using namespace std;
const int R = 1e6 + 1;
const int INF = 1e9;
long long pot(long long a) { return 1LL << a; }
int main() {
  long long a, b;
  scanf("%lld%lld", &a, &b);
  int ile = 0;
  long long p = b;
  while (p) {
    p >>= 1;
    ile++;
  }
  int wyn = 0;
  while (ile > 0) {
    int wys = ile - 2;
    while (wys >= 0) {
      long long pom = pot(ile) - pot(wys) - 1;
      if (a <= pom && pom <= b) wyn++;
      wys--;
    }
    ile--;
  }
  printf("%d", wyn);
  return 0;
}
