Tim purchased a new digital lock which he successfully installed to secure his cabinet. The lock takes in a 5 digit numeric code to activate the lock. After the installation of the lock, Tim entered a 5 digit code to activate the lock.

Enter 5 digit number ---> Press Lock ---> Lock Enabled --> Lock code stored.

However, after a few days, when he was trying to unlock the cabinet, but he forgot the original lock code and was not able to unlock it. He tried the different combinations that he remembered but in vain. 

Tim reached out to his friend Alex who is an electrical engineer. Using a digital probe, he was able to hack in and attach the probe to the main board of the digital lock. Once attached, he was able to read the data stored in the lock ERPOM (memory).  The data looks like 1011011001010110 i.e. a stream of binary numbers. 

Upon further research about the lock and its internal storage mechanism, the lock stores the 5 digit combination code as binary data. Help Tim unlock his lock by decoding the binary data back to 5 digit lock code so that he can unlock his cabinet without having to break the cabinet door. 

Digital Probe --> Read Memory ---> Binary Code (110111011010011) ---> Write a program to convert back to decimal code

Program

Write a program to unlock the lock given the lock data as input.

Input

  • Input 5 digit combination lock data (binary).

Output 

  • The original lock combination code in decimal.

Test cases

No
Input (B)
(Lock Combination Binary Data)
Output (D)
(Lock Combination Code)
1
110111011010011
28371
2
10100011100001001
83721
3
100101101011100
19292

Instructions 

  • Accept the lock combination binary data (B) as input via the command line arguments.
  • Write the logic to convert lock's binary data to decimal code (D).
  • Print out the original lock code.