
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.
Input
One number Ì (0 < Ì < 10000).
Output
One number is the level of palindrome.
Example input865 |
Example output2 |