#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n, m, now, temp, ans, len;
  scanf("%lld%lld", &n, &m);
  now = 2, ans = 0, len = 1;
  while (now <= 1e18) {
    if (now >= n && now <= m) ans++;
    if (now & 1) {
      temp = now ^ ((1ll << 62) - 1);
      temp = temp & -temp;
      now += temp;
      now -= temp / 2;
    } else {
      now = (now << 1) + 3;
      now -= (1ll << len);
      len++;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
