Ordered numbers#4858

Ordered numbers

1 second
128 megabytes
Medium

Misha has a developed aesthetic feeling. He believes that not all numbers are equally ordered. When he is sad, he begins to invent numbers and put them in order.

Misha likes to consider the sum of digits of a number. In order to put in order a number , he first writes the number itself. Then he writes the sum of the digits of this number. Then the sum of digits of the sum of digits, and so on, until the next number becomes one-digit number. He believes that the result of putting the number in order is the sum of all the numbers written out, including the number itself.

Misha loves this process so much that he even replaces his sheep count with it when he cannot sleep for a long time. He remembers that last night, when he put the number in order in his mind, he got the number . But the trouble is - he doesn't remember which number he took! Help him to find this number.

Input

One positive integer (1 \leq b \leq 10^9).

Output

If there exists such number , that after putting it in order, it becomes , then output any such number. If Misha somewhere was mistaken in the calculations and such number does not exist, print .

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading