410542: GYM104048 C Capturing Bronze
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
C. Capturing Bronzetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
You are given $$$n$$$ ($$$1 \leq n \leq 100$$$) pieces of bronze. Each piece of bronze has a distinct weight ranging from $$$1$$$ to $$$n$$$. The nearby pawn shop has interesting criteria for determining whether or not they will take a piece of bronze. They will weigh the piece of bronze, take the sum of the squares of all digits in the weight, and repeat this process with the new sum. If this number eventually reaches $$$1$$$, they will accept the piece of bronze. Otherwise, they will reject it. How many pieces of bronze will the pawn shop accept?
InputThe first and only line of input will contain $$$n$$$ ($$$1 \leq n \leq 100$$$).
OutputOutput the number of pieces of bronze the pawn shop will accept.
ExamplesInput5Output
1Input
1Output
1Input
20Output
5