// One zero, by Errichto
// O(log^2(n))
#include<bits/stdc++.h>
using namespace std;
int main() {
long long a, b;
scanf("%lld%lld", &a, &b);
int c = 0;
for(int i = 0; (1LL << i) / 2 <= b; ++i)
for(int j = 0; j <= i - 2; ++j) {
long long x = (1LL << i) - 1 - (1LL << j);
c += a <= x && x <= b;
}
printf("%d\n", c);
return 0;
}
Ly8gT25lIHplcm8sIGJ5IEVycmljaHRvCi8vIE8obG9nXjIobikpCiNpbmNsdWRlPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCWxvbmcgbG9uZyBhLCBiOwoJc2NhbmYoIiVsbGQlbGxkIiwgJmEsICZiKTsKCWludCBjID0gMDsKCWZvcihpbnQgaSA9IDA7ICgxTEwgPDwgaSkgLyAyIDw9IGI7ICsraSkKCQlmb3IoaW50IGogPSAwOyBqIDw9IGkgLSAyOyArK2opIHsKCQkJbG9uZyBsb25nIHggPSAoMUxMIDw8IGkpIC0gMSAtICgxTEwgPDwgaik7CgkJCWMgKz0gYSA8PSB4ICYmIHggPD0gYjsKCQl9CglwcmludGYoIiVkXG4iLCBjKTsKCXJldHVybiAwOwp9