Ralph and arithmetic#11035

Ralph and arithmetic

1 second
128 megabytes
Medium

Ralph is a minor character in a computer game, and he is tired of being in the shadow of the main character. Ralph noticed something in common between his computer game and arithmetic.

Ralph believes that in arithmetic, some numbers occur more often than others, making all other numbers secondary. To test his hypothesis, Ralph wrote down all the minor digits and now wants to know the number of numbers from to that do not contain minor digits in their decimal notation. Help him do it.

Input

The first line contains an integer (1 \le n \le 10^{18}). The second line contains an integer (1 \le k \le 9) - the number of digits Ralph considers minor. The third line contains the minor digits d_1, \ldots, d_k (0 \le d_1 < d_2 < \ldots < d_k \le 9).

Output

Print one number - the number of numbers from to whose decimal notation does not contain minor digits.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Example 3

Loading
Loading

Note

In the first test, all numbers from to are suitable, except for and .

In the second test, only numbers , and match.

In the third test, all numbers from to in length, consisting only of and , are suitable.