911.C. Alternating Generator
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Bystroszczyot Algebrovic wanted to come up with a method for generating numbers, so he created an algorithm that takes a positive integer $$$x$$$ and generates the result according to the following scheme:

  1. Reduce the current number $$$x$$$ to $$$x-1$$$
  2. Double the current number $$$x$$$ to $$$2 \cdot x$$$

All steps of the algorithm should alternate, meaning that the algorithm should work in the following order: $$$1,2,1,2,\dots$$$. Additionally, the algorithm can start not from the first step, but from the second step, and should perform the steps in the following order: $$$2,1,2,1,\dots$$$. For example, from the number $$$7$$$, the algorithm can generate the numbers: $$$7 \rightarrow 14 \rightarrow 13 \rightarrow 26 \rightarrow \dots$$$ or the numbers $$$7 \rightarrow 6 \rightarrow 12 \rightarrow 11 \rightarrow \dots$$$.

Now Bystroszczyot wants to know, for a given number $$$i$$$, which numbers can generate the number $$$i$$$ if the algorithm is started from them? More precisely, let's define the set $$$B_i$$$ as all numbers from which the number $$$i$$$ can be obtained after some (possibly zero) number of algorithm iterations, and let $$$|B_i|$$$ denote the quontity of numbers in the set $$$B_i$$$. The numbers in the set $$$B_i$$$ will be called generating numbers for the number $$$i$$$. Bystroszczyot is interested in finding the total number of generating numbers for all integers from $$$l$$$ to $$$r$$$, in other words, the value of $$$\sum\limits_{i = l}^{r} |B_i|$$$. Help him calculate the answer!

Input

The input consists of a single line containing two integers $$$l$$$ and $$$r$$$ $$$(1 \le l \le r \le 10^{18})$$$.

Output

Output a single integer — the answer to the problem.

Example
Input
9 14
Output
34