~/algor $ cat problems/while-ikkilikdan-onlikka
Binary to decimal
Easy
1000 ms
64 MB
32%
A number $n$ written in the binary numeral system is given (it consists only of the digits $0$ and $1$). Convert it to decimal: the last digit is multiplied by $2^{0}$, the one before it by $2^{1}$, the next by $2^{2}$ and so on, and everything is added up.
$$1011_{2} = 1 * 2^{3} + 0 * 2^{2} + 1 * 2^{1} + 1 * 2^{0} = 11$$
Input
One integer $n$ (its binary notation).
Output
One integer — the value of $n$ in the decimal system.
Note
$0 \le n \le 111111111111111111$
the notation of $n$ contains only the digits $0$ and $1$
Examples
Input #1
1011
Output #1
11
Input #2
100000
Output #2
32