Equal Digit Products

Count N-digit numbers whose digits in odd positions have the same product as the digits in even positions.

Medium7Dynamic programmingCombinatoricsMathNo attempts yetTime limit1sMemory limit128 MB

Problem

Marija likes to play with all sorts of things, numbers among them. This time she asks the following. Given a natural number NN, how many natural numbers XX with exactly NN digits have the product of the digits in even positions equal to the product of the digits in odd positions?

Positions are numbered from left to right. The leading digit, the one with the largest place value, is position 1, so it lies in an odd position. Since XX has exactly NN digits, the leading digit is not 0.

A product over no digits is defined as 1. So when NN is 1 there is no even position and the product of the digits in even positions is 1.

Input

The first and only line contains a natural number NN (1N141 \le N \le 14).

Output

Print the number of natural numbers that satisfy the condition.