#29 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.

Time Limit: 1 seconds
Balls for the passed test: 10
Complexity: 36%

Example

Example input

865

Example output

2


Problem URL: http://www.e-olimp.com.ua/en/problems/29