410551: GYM104049 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?

Input

The first and only line of input will contain $$$n$$$ ($$$1 \leq n \leq 100$$$).

Output

Output the number of pieces of bronze the pawn shop will accept.

ExamplesInput
5
Output
1
Input
1
Output
1
Input
20
Output
5

加入题单

算法标签: