Problem: You are given two integer numbers, and . You may perform several operations with the integer .
Each operation you perform is the following one: choose any digit that occurs in the decimal representation of at least once, and replace by .
You want to make the length of decimal representation of (without leading zeroes) equal to . What is the minimum number of operations required to do that?
Input Format: The only line of the input contains two integers and (; ).
Output Format: Print one integer — the minimum number of operations required to make the length of decimal representation of (without leading zeroes) equal to , or if it is impossible.
Note: In the second example, the following sequence of operations achieves the goal:
- multiply by , so ;
- multiply by , so ;
- multiply by , so ;
- multiply by , so .