9119: ABC336 —— B - CTZ
[Creator : ]
Description
For a positive integer $X$, let $\text{ctz}(X)$ be the (maximal) number of consecutive zeros at the end of the binary notation of $X$.
If the binary notation of $X$ ends with a $1$, then $\text{ctz}(X)=0$.
You are given a positive integer $N$. Print $\text{ctz}(N)$.
If the binary notation of $X$ ends with a $1$, then $\text{ctz}(X)=0$.
You are given a positive integer $N$. Print $\text{ctz}(N)$.
Input
The input is given from Standard Input in the following format:
```
$N$
```
```
$N$
```
Output
Print $\text{ctz}(N)$.
Constraints
- $1\leq N\leq 10^9$
- $N$ is an integer.
- $N$ is an integer.
Sample 1 Input
2024
Sample 1 Output
3
2024 is 11111101000 in binary, with three consecutive 0s from the end, so ctz(2024)=3.
Thus, print 3.
Thus, print 3.
Sample 2 Input
18
Sample 2 Output
1
18 is 10010 in binary, so ctz(18)=1.
Note that we count the trailing zeros.
Note that we count the trailing zeros.
Sample 3 Input
5
Sample 3 Output
0
HINT
相同题目:ABC336。