atcoder#AGC015D. [AGC015D] A or...or B Problem

[AGC015D] A or...or B Problem

Score : 900900 points

Problem Statement

Nukes has an integer that can be represented as the bitwise OR of one or more integers between AA and BB (inclusive). How many possible candidates of the value of Nukes's integer there are?

Constraints

  • 1AB<2601 \leq A \leq B < 2^{60}
  • AA and BB are integers.

Input

The input is given from Standard Input in the following format:

AA

BB

Output

Print the number of possible candidates of the value of Nukes's integer.

7
9
4

In this case, A=7A=7 and B=9B=9. There are four integers that can be represented as the bitwise OR of a non-empty subset of {77, 88, 99}: 77, 88, 99 and 1515.

65
98
63
271828182845904523
314159265358979323
68833183630578410