#P2000. 拯救世界

拯救世界

Description

To save the world, Xiao A and uim decide to summon the deities kkksc03 and lzn. According to ancient records, summoning any one deity requires arranging a specific grand formation using the Five-Element divine stones: Metal, Wood, Water, Fire, and Earth. The records state the following:

Summoning method for the deity kkksc03:

  • The number of Metal stones must be a multiple of 66.
  • At most 99 Wood stones can be used.
  • At most 55 Water stones can be used.
  • The number of Fire stones must be a multiple of 44.
  • At most 77 Earth stones can be used.

Summoning method for the deity lzn:

  • The number of Metal stones must be a multiple of 22.
  • At most 11 Wood stone can be used.
  • The number of Water stones must be a multiple of 88.
  • The number of Fire stones must be a multiple of 1010.
  • At most 33 Earth stones can be used.

It is December 3131, 19991999. Xiao A and uim started searching at 00:00:0000{:}00{:}00 and kept looking until 23:00:0023{:}00{:}00, but still could not find the divine stones.

However, after returning home, they discovered some strange items in their cellar. Consulting the ancient records—oh my, if only they had come earlier!—they found some chaos stones that can decay into the Five-Element divine stones by hammering. So they hammered frantically and finally obtained nn divine stones, completing two formations at 23:59:5923{:}59{:}59.

Indeed, the deities kkksc03 and lzn appeared, but due to insufficient energy, they could not exert their power. Only by setting up all formations that can be arranged using nn stones can they be fully charged. Xiao A and uim were dumbfounded and quickly contacted you to help calculate how many formations there are in total.

Input Format

Input a positive integer nn.

Output Format

Output the number of formations that can be arranged using nn chaos stones.

2
15

Hint

Constraints

For all testdata, 1099999n<1010000010^{99999}\leq n\lt 10^{100000}.

Hint

Since it is already 23:59:5923{:}59{:}59, you have only 0.50.5 seconds. (Xiao A and uim need 0.5s0.5\texttt s to lay out all formations.)

Translated by ChatGPT 5