{"raw_statement":[{"iden":"problem statement","content":"Given are integers $N$, $L$, and $R$. Count the number of integers $x$ that satisfy both of the following conditions.\n\n*   $L \\leq x \\leq R$\n*   $(x \\oplus N) < N$ (Here, $\\oplus$ denotes the bitwise $\\mathrm{XOR}$.）\n\nWhat is the bitwise $\\mathrm{XOR}$?The bitwise $\\mathrm{XOR}$ of integers $A$ and $B$, $A\\oplus B$, is defined as follows:\n\n*   When $A\\oplus B$ is written in base two, the digit in the $2^k$'s place ($k \\geq 0$) is $1$ if exactly one of $A$ and $B$ is $1$, and $0$ otherwise.\n\nFor example, we have $3\\oplus 5 = 6$ (in base two: $011\\oplus 101 = 110$)."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^{18}$\n*   $1 \\leq L \\leq R \\leq 10^{18}$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $L$ $R$"},{"iden":"sample input 1","content":"2 1 2"},{"iden":"sample output 1","content":"1\n\nFor $x=1$, $L \\leq x \\leq R$ is satisfied, but $(x \\oplus N) < N$ is not. For $x=2$, both conditions are satisfied. There is no other $x$ that satisfies the conditions."},{"iden":"sample input 2","content":"10 2 19"},{"iden":"sample output 2","content":"10"},{"iden":"sample input 3","content":"1000000000000000000 1 1000000000000000000"},{"iden":"sample output 3","content":"847078495393153025"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}