Octal, Decimal, Hexadecimal

Convert one integer given in octal, decimal, or hexadecimal notation to its decimal value.

Easy2ImplementationMathNo attempts yetTime limit1sMemory limit256 MB

Problem

You are given one integer X. It is written in octal, decimal, or hexadecimal.

An octal number has a leading 0, and a hexadecimal number has a leading 0x. A number with no prefix is decimal.

Write a program that converts X to decimal and prints it.

Input

The first line contains X. Converted to decimal, X is a natural number less than or equal to 1,000,000. A hexadecimal number uses lowercase letters only.

Output

Print the decimal value of X on the first line.