#arc129a. [arc129_a]Smaller XOR

[arc129_a]Smaller XOR

Problem Statement

Given are integers NN, LL, and RR. Count the number of integers xx that satisfy both of the following conditions.

  • LleqxleqRL \\leq x \\leq R
  • (xoplusN)<N(x \\oplus N) < N (Here, oplus\\oplus denotes the bitwise mathrmXOR\\mathrm{XOR}.)

What is the bitwise mathrmXOR\\mathrm{XOR}?

The bitwise mathrmXOR\\mathrm{XOR} of integers AA and BB, AoplusBA\\oplus B, is defined as follows:

  • When AoplusBA\\oplus B is written in base two, the digit in the 2k2^k's place (kgeq0k \\geq 0) is 11 if exactly one of AA and BB is 11, and 00 otherwise.

For example, we have 3oplus5=63\\oplus 5 = 6 (in base two: 011oplus101=110011\\oplus 101 = 110).

Constraints

  • 1leqNleq10181 \\leq N \\leq 10^{18}
  • 1leqLleqRleq10181 \\leq L \\leq R \\leq 10^{18}
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN LL RR

Output

Print the answer.


Sample Input 1

2 1 2

Sample Output 1

1

For x=1x=1, LleqxleqRL \\leq x \\leq R is satisfied, but (xoplusN)<N(x \\oplus N) < N is not. For x=2x=2, both conditions are satisfied. There is no other xx that satisfies the conditions.


Sample Input 2

10 2 19

Sample Output 2

10

Sample Input 3

1000000000000000000 1 1000000000000000000

Sample Output 3

847078495393153025