#arc129a. [arc129_a]Smaller XOR
[arc129_a]Smaller XOR
Problem Statement
Given are integers , , and . Count the number of integers that satisfy both of the following conditions.
- (Here, denotes the bitwise .)
What is the bitwise ?
The bitwise of integers and , , is defined as follows:
- When is written in base two, the digit in the 's place () is if exactly one of and is , and otherwise.
For example, we have (in base two: ).
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2 1 2
Sample Output 1
1
For , is satisfied, but is not. For , both conditions are satisfied. There is no other that satisfies the conditions.
Sample Input 2
10 2 19
Sample Output 2
10
Sample Input 3
1000000000000000000 1 1000000000000000000
Sample Output 3
847078495393153025