Given matchsticks, how many equations of the form can you spell out? , , and in the equation are integers spelled out with matchsticks (if the number is non-zero, the highest digit cannot be 0). The spelling of numbers 0-9 with matchsticks is shown in the figure:
Note:
- The plus sign and the equal sign each require two matchsticks.
- If , then and are regarded as different equations ()
- All matchsticks must be used.
Input Specification
One line: an integer ().
Output Specification
One line, indicating the number of different equations that can be spelled.
Sample Input 1
14
Sample Output 1
2
Explanation of Sample Output 1
The 2 equations are and .
Sample Input 2
18
Sample Output 2
9
Explanation of Sample Output 2
The 9 equations are:
Comments