Good Bye 2015
B
New Year and Old Property
Codeforces
1300
原题
← AC →
翻译中…

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.

翻译中…

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.

翻译中…

样例

Input #1
5 10
Output #1
2
InputCopy OutputCopy
Input #2
2015 2015
Output #2
1
InputCopy OutputCopy
Input #3
100 105
Output #3
0
InputCopy OutputCopy
Input #4
72057594000000000 72057595000000000
Output #4
26
InputCopy OutputCopy
题目信息
题号
611B
所属比赛
时间限制
2 s
内存限制
256 MB
标签
位运算
暴力
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。