eolymp
bolt
Try our new interface for solving problems
Problems

From base k to base 10

From base k to base 10

Time limit 1 second
Memory limit 128 MiB

The number n is given in the base k system. Convert number n into decimal system.

Input data

Two non-negative integers k (2k10) and n.

Output data

Print one number n in the decimal system. It is guaranteed that n is no more than 10^9 in decimal notation.

Examples

Input example #1
2
1
Output example #1
1
Input example #2
6
53414
Output example #2
7282