# Sum vs XOR

**Problem Statement**

Given an integer, , find each such that:

where denotes the bitwise XOR operator. Then print an integer denoting the total number of ‘s satisfying the criteria above.

**Input Format**

A single integer, .

**Constraints**

**Output Format**

Print the total number of integer ‘s satisfying both of the conditions specified above.

**Sample Input**

5

**Sample Output**

2

**Explanation**

For , the values and satisfy the conditions:

Thus, we print as our answer.

**Solution**

public class SumVsXor { public static void main(String[] args) throws FileNotFoundException { System.setIn(new FileInputStream(System.getProperty("user.home") + "/" + "in.txt")); Scanner in = new Scanner(System.in); long n = in.nextLong(); int zeros = 0; while (n > 0) { if ((n & 1) == 0) { zeros++; } n = n >> 1; } long ans = 1l << zeros; System.out.println(ans); } }