The level of palindrome#29

The level of palindrome

1 second
122.174 megabytes
Easy
prb29

Given a positive integer . If is not a palindrome, write its digits in reverse order and add this number to . Repeat this procedure until a palindrome is obtained. The number of such operations is called the palindrome level of .

Find the palindrome level of .

Input

The input contains a single integer (0 < m < 10000).

Output

Print the palindrome level of .

Examples

Example 1

Loading
Loading