{"problem":{"name":"Factorial Yen Coin","description":{"content":"The coins used in the Kingdom of Takahashi are $1!$\\-yen coins, $2!$\\-yen coins, $\\dots$, and $10!$\\-yen coins. Here, $N! = 1 \\times 2 \\times \\dots \\times N$. Takahashi has $100$ of every kind of coin","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc208_b"},"statements":[{"statement_type":"Markdown","content":"The coins used in the Kingdom of Takahashi are $1!$\\-yen coins, $2!$\\-yen coins, $\\dots$, and $10!$\\-yen coins. Here, $N! = 1 \\times 2 \\times \\dots \\times N$.\nTakahashi has $100$ of every kind of coin, and he is going to buy a product worth $P$ yen **by giving the exact amount without receiving change**.\nWe can prove that there is always such a way to make payment.\nAt least how many coins does he need to use in his payment?\n\n## Constraints\n\n*   $1 \\leq P \\leq 10^7$\n*   $P$ is an integer.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$P$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc208_b","tags":[],"sample_group":[["9","3\n\nBy giving one $(1! =) 1$\\-yen coin, one $(2! =) 2$\\-yen coin, and one $(3! =) 6$\\-yen coin, we can make the exact payment for the product worth $9$ yen. There is no way to pay this amount using fewer coins."],["119","10\n\nWe should use one $1!$\\-yen coin, two $2!$\\-yen coins, three $3!$\\-yen coins, and four $4!$\\-yen coins."],["10000000","24"]],"created_at":"2026-03-03 11:01:13"}}