#C422. Hexadecimal to Decimal Conversion

    ID: 47734 Type: Default 1000ms 256MiB

Hexadecimal to Decimal Conversion

Hexadecimal to Decimal Conversion

This problem requires you to convert a hexadecimal number (base 16) represented as a string into its decimal (base 10) equivalent. The conversion should follow the formula:

\( v = \sum_{i=0}^{n-1} d_i \times 16^{(n-1-i)} \)

where \( d_i \) is the decimal value of the hexadecimal digit at position \( i \) and \( n \) is the length of the string. The hexadecimal string may contain digits from 0-9 and letters a-f (or A-F). Your program should read the input from standard input (stdin) and output the result to standard output (stdout).

inputFormat

The input consists of a single line containing a non-empty hexadecimal string. The string is guaranteed to contain only valid hexadecimal characters (0-9, a-f, A-F).

outputFormat

Output a single integer which is the decimal equivalent of the given hexadecimal string.

## sample
1a
26