Limits 1s, 512 MB

Moeen lives in a home section or blocks with 100 floors numbered from 0 to 99. The home has an elevator with a digital counter showing the floor that the elevator is currently on. The elevator shows each digit of a number with 7 light sticks by applying them on or off. The picture below shows how the elevator shows each digit.

One day when Moeen wanted to go from floor 88 to floor 0 using the elevator he noticed that the counter shows number 89 instead of 88. Then when the elevator started moving the number on the counter changed to 87. After a little meditation, Moeen came to the conclusion that there is only one explanation for this: One of the sticks of the counter was broken. Later that day Moeen was thinking about the broken stick and suddenly he came up with the following problem.

Suppose the digital counter is showing number n. Moeen calls an integer xx (0x990 ≤ x ≤ 99) good if it's possible that the digital counter was supposed to show xx but because of some(possibly none) broken sticks it's showing n instead. Moeen wants to know a number of good integers for a specific nn. So you must write a program that calculates this number. Please note that the counter always shows two digits.

Input

Input starts with a line of contains exactly two digits representing number nn (0n990 ≤ n ≤ 99). Note that nn may have a leading zero

Output

Print the output the number of good integers.

Samples

InputOutput
44
9
InputOutput
55
16
InputOutput
66
4

Note that MM may have a leading zero.

Submit

Login to submit.

Statistics

67% Solution Ratio
sarwarITEarliest, Dec '17
mdvirusFastest, 0.0s
mdvirusLightest, 0 B
Nusab19Shortest, 54B
Toph uses cookies. By continuing you agree to our Cookie Policy.