~/algor $ cat problems/qidiruv-sonni-topish-oyini
Guess the number
Easy
1000 ms
128 MB
23%
Ali has thought of one of the numbers from $1$ to $n$ — the number $x$. Vali finds it as follows. At first the search range is $[l; r] = [1; n]$. Each time Vali names the middle number of the range $m = \lfloor (l + r) / 2 \rfloor$: if $m = x$, the game ends; if $m \lt x$, the range becomes $[m + 1; r]$, and if $m \gt x$, it becomes $[l; m - 1]$. How many numbers does Vali name in total?
Input
One line with two positive integers: $n$ and $x$.
Output
One positive integer — the number of named numbers.
Note
$1 \le x \le n \le 10^{18}$
Examples
Input #1
10 7
Output #1
4
Input #2
1 1
Output #2
1