lowerbound, upperbound = map(int, raw_input().split())
c = 0
for i in range(len(bin(lowerbound))-2, len(bin(upperbound))-1):
s = ['1'] * i
for j in range(len(s)-1):
k = s[:]
k[len(k)-1-j] = '0'
k = int(''.join(k), 2)
if (k<=upperbound) and (k>=lowerbound):
c += 1
print c
bG93ZXJib3VuZCwgdXBwZXJib3VuZCA9IG1hcChpbnQsIHJhd19pbnB1dCgpLnNwbGl0KCkpCmMgPSAwCmZvciBpIGluIHJhbmdlKGxlbihiaW4obG93ZXJib3VuZCkpLTIsIGxlbihiaW4odXBwZXJib3VuZCkpLTEpOgogICAgcyA9IFsnMSddICogaQogICAgZm9yIGogaW4gcmFuZ2UobGVuKHMpLTEpOgogICAgICAgIGsgPSBzWzpdCiAgICAgICAga1tsZW4oayktMS1qXSA9ICcwJwogICAgICAgIGsgPSBpbnQoJycuam9pbihrKSwgMikKICAgICAgICBpZiAoazw9dXBwZXJib3VuZCkgYW5kIChrPj1sb3dlcmJvdW5kKToKICAgICAgICAgICAgYyArPSAxCnByaW50IGM=