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