The year 2015 is almost over.

Limak is a little polar bear. He has recently learnt about the binary system. He noticed that the passing year has exactly one zero in its representation in the binary system — 2015_10 = 11111011111_2. Note that he doesn't care about the number of zeros in the decimal representation.

Limak chose some interval of years. He is going to count all years from this interval that have exactly one zero in the binary representation. Can you do it faster?

Assume that all positive integers are always written without leading zeros.


-----Input-----

The only line of the input contains two integers a and b (1 ≤ a ≤ b ≤ 10^18) — the first year and the last year in Limak's interval respectively.


-----Output-----

Print one integer – the number of years Limak will count in his chosen interval.


-----Examples-----
Input
5 10

Output
2

Input
2015 2015

Output
1

Input
100 105

Output
0

Input
72057594000000000 72057595000000000

Output
26



-----Note-----

In the first sample Limak's interval contains numbers 5_10 = 101_2, 6_10 = 110_2, 7_10 = 111_2, 8_10 = 1000_2, 9_10 = 1001_2 and 10_10 = 1010_2. Two of them (101_2 and 110_2) have the described property.

Difficulty: interview

Starter code:

Solutions:
def zero(strx):
    k = []
    str2 = list(strx)
    for i in range(1, len(str2)):
        str3 = str2[:]
        str3[i] = '0'
        k.append(''.join(str3))
    return k
a = []
for i in range(1, 64):
    a += zero('1'*i)

ct = 0
x, y = list(map(int, input().split(' ')))
for i in a:
    if x <= int(i, 2) <= y:
        ct+=1
print(ct)


def f(x):
    res = 0
    for i in range(64):
        for j in range(i + 1, 64):
            t = 0
            for k in range(j + 1):
                if k != i:
                    t += 1 << k
            if t <= x:
                res += 1
    return res
    

def main():
    a, b = [int(i) for i in input().split()]
    print(f(b) - f(a - 1))
    
    
main()

x = input("").split(' ')
a = int(x[0])
b = int(x[1])
pow2 = []
for g in range (66):
 pow2.append(1<<g)
def solve (c):
 cnt = 0
 for g in range (66):
   k = 0
   for y in range (g):
    k|=(1<<y)
   for y in range (g+1, 66):
    k|=(1<<y)
    if (k <= c):
     cnt+=1
 return cnt

print(solve(b) - solve(a-1))

a, b = map(int, input().split())
cnt = 0
for i in range(1, 64):
    k = (1 << i) - 1
    for j in range(0, i - 1):
        num = k - (1 << j)
        if (a <= num and num <= b): 
            cnt += 1
print(cnt)

x, y = list(map(int, input().split()))
ans = 0
for left in range(1, 100):
    s = '1' * left + '0'
    for right in range(100):
        a = int(s, 2)
        if (a > y):
            break
        if (a >= x):
            ans += 1
        s += '1'
print(ans)


def main():
	tok = input().split()
	A = int(tok[0])
	B = int(tok[1])

	ans = 0
	for a in range(1, 70):
		for b in range(70):
			num = (2**a - 1) * (2**(b + 1)) + (2**b - 1)
			if num >= A and num <= B:
				ans += 1
	
	print(ans)


main()


a, b = list(map(int, input().split()))

ans = 0
for l in range(1, 70):
    for pos in range(l - 1):
        x = 2 ** l - 1 - 2 ** pos
        if a <= x <= b:
            ans += 1
print(ans)


a = []
for i in range(1,62):
  for j in range(i):
    a.append(int("1" * (i - j) + "0" + "1" * j, base=2))
#print(a)
x,y = list(map(int, input().split()))
print(len(list([d for d in a if x <= d and d <= y])))




3

gen = []

for i in range(1,70):
    x = (1 << i) - 1
    for j in range(i - 1):
        gen.append(x ^ (1 << j))

gen = list(set(gen))

a, b = list(map(int, input().split()))
ans = 0
for y in gen:
    if a <= y <= b:
        ans += 1

print(ans)


from math import *

def bindec(ch):
    r = 0
    p = 1
    n = len(ch)
    for k in range(n):
        r += int(ch[n-1-k])*p
        p *= 2
    return r

a,b = list(map(int,input().split()))
la = int(log(a,2))+1
lb = int(log(b,2))+1
r = 0
ch = ""
for k in range(la,lb+1):
    for i in range(1,k):
        ch = "1"*i+"0"+"1"*(k-i-1)
        if bindec(ch) > b:
            break
        elif bindec(ch) >= a:
            r += 1
print(r)


a, b = list(map(int, input().split()))

def cnt(x):
    l = x.bit_length()
    res = 0
    for di in range(l):
        s = (1 << (l - di + 1)) - 1
        for i in range(l - di):
            if (s ^ (1 << i)) <= x:
                res += 1
    return res

print(cnt(b) - cnt(a - 1))


a, b = list(map(int, input().split()))

maxL = 60
sol = 0

for l in range(1, maxL+1):
    for p in range(1, l+1):
        binYear = '1' * p + '0' + (l-p) * '1'
        #print(binYear)

        decYear = int(binYear, 2)

        if a <= decYear and decYear <= b:
            sol += 1

print(sol)



a, b = map(int, input().split())
ans = 0

full = 0
for mp in range(100):
    full += 2 ** mp
    for zp in range(mp):
        curr = full - 2 ** zp
        if a <= curr <= b:
            ans += 1
print(ans)

low, high = [int(x) for x in input().split()]

a = 2
x = 0
tot = 0
while True:
    for b in reversed(list(range(a-1))):
        x = 2**a - 1 - 2**b
        if x < low: continue
        if x > high: break
        tot += 1
    if x > high: break
    a += 1
print(tot)


__author__ = 'Utena'
a,b=map(int,input().split())
n=2
t=0
n1=1
c=0
while True:
    if n1>b:break
    else:
        n*=2
        n1=n-1
        c+=1
        n2=1
        for i in range(c):
            if n1-n2>=a and n1-n2<=b:
                t+=1
            n2*=2
print(t)

a, b = list(map(int, input().split()))
ans = 0
N = 0
for i in range(2, 61):
    N = (1 << i) - 1
    for j in range(N.bit_length() - 1):
        x = N - (1 << j)
        if a <= x <= b:
            ans += 1
print(ans)
            
    


def vten(c, n):
    c = str(c)
    ans = 0
    for i in range(0, len(c)):
        ans += int(c[len(c) - i - 1]) * n ** i
    return ans


def vk(ch, k):
    ans = ''
    while ch != 0:
        ans += str(ch % k)
        ch //= k
    return ans[::-1]

ans = []
for x in range(60):
    for i in range(1, x + 1):
        s = '1' * i
        s += '0'
        s += '1' * (x - i)
        y = vten(int(s), 2)
        ans.append(y)

a, b = list(map(int, input().split()))
answer = 0
for i in ans:
    if i >= a and i <= b:
        answer += 1
print(answer)


a, b = list(map(int, input().split()))
print(sum((2 ** i - 1) ^ 2 ** j in range(a, b + 1) for i in range(2, 65) for j in range(i - 1)))


#!/bin/python
import collections
import random
import sys
try:
    from tqdm import tqdm
except:
    def tqdm(iterable):
        return iterable


__taskname = ''
if __taskname:
    sys.stdin = open(__taskname + '.in')
    sys.stdout = open(__taskname + '.out', 'w')

def f(n):
    result = set()
    i = 0
    while (1 << i) <= 4 * n:
        for j in range(i - 1):
            if (1 << i) - 1 - (1 << j) <= n:
                result.add((1 << i) - 1 - (1 << j))
        i += 1
    return len(result)


a, b = list(map(int, input().split()))
print(f(b) - f(a - 1))


#!/usr/bin/env python3
a, b = list(map(int,input().split()))
cnt = 0
for i in range(2,64*8):
    for j in range(1,i):
        c = ['1'] * i
        c[j] = '0'
        c = int(''.join(c), 2)
        if a <= c <= b:
            cnt += 1
print(cnt)


ans = 0
a, b = list(map(int, input().split()))
l = 2
pos = l-2
ans = 0
while True:
    n = ((1 << l) - 1) - (1 << pos)
    #print(l, pos, n)
    if n > b:
        break
    if n >= a:
        ans += 1
    if pos > 0:
        pos -= 1
    else:
        l += 1
        pos = l-2
print(ans)
    


a,b = map(int,input().split())

List = []
for i in range(2,61):
    for j in range(i-2,-1,-1):
        List+=[(1<<i)-(1<<j)-1]

res = 0
for i in List:
    if a<=i and i<=b: res+=1

print(res)

import itertools
import math
import bisect

one_zero = []
for i in range(2, 180):
    for k in range(1,i):
        one_zero.append(int('1'*k + '0' + '1'*(i-k-1), base = 2))


a, b = [int(x) for x in input().split()]
print(bisect.bisect_right(one_zero, b) - bisect.bisect_left(one_zero, a))



k = 1
ans = 0
a, b = list(map(int, input().split()))
for i in range(60):
    k <<= 1
    d = 1
    for j in range(i):
        if a <= (k - (d << j) - 1) <= b:
            ans += 1
print(ans)


import math
import sys

#sys.stdin = open('input.txt')
#sys.stdout = open('output.txt', 'w')

a, b = map(int, input().split())
count = 0

for i in range(int(math.log2(a)) - 1, int(math.log2(b)) + 1):
    base = 2 ** (i + 1) - 1
    for j in range(i):
        if a <= (base - 2 ** j) <= b:
            count += 1

print(count)