Time

10:46:34
11 Feb 2012
ACM-ICPC Thailand Southern Region Programming Contest 2011
Left: 4 hours 14 minutes
End: 11.02.2012 15:00
Leader: Informatimukas
Five for week 22
Left: 11 hours 14 minutes
End: 11.02.2012 22:00
Leader: NuM
Version for print

The level of palindrome

prb29

   You have a natural number M. If it is not a palindrome, than we write it in back order and add it to natural number M. Steps is repeat till we will receive a number- palindrome. The quantity of operations we call the level of palindrome of natural number M.

   Find the level of palindrome of number M.

 


Specifications

   Input

   One number Ì (0 < Ì < 10000).

   Output

   One number is the level of palindrome.


Problem information

Time Limit: 1 seconds
Memory Limit: 64 MB
Balls for the passed test: 10
Complexity: 36% 303/477

Example

Example input

865

Example output

2


← Product Problems Certification →