eolymp
bolt
Try our new interface for solving problems
Problems

From base k to base 10

From base k to base 10

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

Input

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

Output

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

Time limit 1 second
Memory limit 128 MiB
Input example #1
2
1
Output example #1
1
Input example #2
6
53414
Output example #2
7282