Calculator#6319

Calculator

1 secondo
256 megabyte
Molto difficile

Members of a secret group have devised a simple method to recognize each other. When they meet, one member states a number, and the other must reply with a number. This response is the count of numbers whose digit sum is less than the digit sum of the given number , and whose digit product is greater than the product of the digits of .

Since calculating this mentally is quite difficult, the group needs a special calculator with this function built in. Your task is to develop a program for this calculator.

Input

The input consists of a single integer (1 \leq N \leq 10^9).

Output

Output a single natural number: the count of numbers, modulo , whose digit sum is less than the digit sum of , and whose digit product is greater than the product of the digits of .

Esempi

Esempio 1

Loading
Loading