Competitions

# PP2. Week 5: April 5 - 11

# 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** (**2** ≤ **k** ≤ **10**) and **n**.

#### Output

Print one number **n** in the decimal system. It is guaranteed that **n** is no more than `10`

in decimal notation.^{9}

Input example #1

2 1

Output example #1

1

Input example #2

6 53414

Output example #2

7282