Time limit: 0.35s
Memory limit: 256MB
Input:
Output:
Given an integer , find how many numbers of digits exist such that the sum of their digits and the product of their digits is equal.
Since the number may be big, print its answer modulo .
Input
The only line of the input contains one integer, ().
For tests worth 10 points, .
For tests worth extra 30 points, .
Output
The only line of the output will contain the required answer.
Example
stdin
2
stdout
1