Problems

# Digits

# Digits

A positive integer which is equal to **C ^{n}**, where

**С**=

**1**..

**9**contains at least

**K**numbers

**C**. For given numbers

**C**and

**K**find the smallest value of

**N**.

**Input**

In the input file contains two numbers **С** and **K**, **K** ≤ **500**.

**Output**

One number **N**.

Input example #1

9 2

Output example #1

5

**Example description:**
9^5=59049 – set of 2 digit 9.