Convert Binary to Decimal Numbers

In computer science, numbers are often represented in binary form. Your task is to develop a program that reads such a binary string from the input and outputs its decimal (base-10) equivalent.
💡
In case you need a refresher, remember that each 1 in a binary string represents a specific power of 2. Summing these powers gives you the equivalent decimal number, starting with the rightmost bit corresponding to and so on. For instance, .

Input

The only line of the input contains the string s consisting of 0s and 1s (1 ≤ |s| ≤ 31).

Output

A single integer, representing the decimal equivalent of the binary string.

Examples

Input
Output
101
5
110
6
111
7
0100110111
311
 

Constraints

Time limit: 1 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue