10335 - Compute Parity   

Description

The parity of a binary word is 1 if the number of 1s in the word is odd; otherwise, it is 0. For example, the parity of 1011 is 1, and the parity of 10001000 is 0. Parity checks are used to detect single bit errors in data storage and communication. It is fairly straightforward to write code that computes the parity of a single 32-bit integer.

Compute the parity of a 32-bit integer?

Input

Each line of the input contains a non-negative 32-bit integer x. Input file is terminated by end of file.

Output

For each line of input you will have to produce one line of output which contains the parity of x.

Sample Input  Download

Sample Output  Download

Tags




Discuss