Count Trailing Zeros in Binary
You are given an integer
n
(in base-10). Write a program to find the number of trailing zeros when n
is converted to its binary representation.💡
For example, the number 456 has a binary representation of 111001000, which has three trailing zeros at the end.
Input
The input contains a single integer
n
(1 ≤ n ≤ ). Output
The program should print the number of trailing zeros in the binary representation of
n
. Examples
Input | Output |
12 | 2 |
456 | 3 |
Constraints
Time limit: 2 seconds
Memory limit: 512 MB
Output limit: 1 MB