1.PERFECT AND GOOD NUMBERS:

Credits: 250

PROBLEM DESCRIPTION:

Let us call P(n) - the product of all digits of number n (in decimal notation).

For example, P(1243)=1*2*4*3=24; P(198501243)=0.

Let us call n to be a good number, if (p(n)<>0) and (n mod P(n)=0).

Let us call n to be a perfect number, if both n and n+1 are good numbers.

You are to write a program, which, given the number K, counts all such

numbers n that n is perfect and n contains exactly K digits in decimal notation.

INPUT:

Only one number K (1<=K<=1000000) is written in input.

OUTPUT:

Output the total number of perfect k-digit numbers.

SAMPLE INPUT:
1

SAMPLE OUTPUT:
8