eolymp
bolt
Try our new interface for solving problems
Problems

Changeling

Changeling

Time limit 1 second
Memory limit 64 MiB

Number of P is said to be inverted in the number N, if the inverted decimal entry coincides with one decimal another. For example, inverted for 3489 will be 9843, but to 2009100 will be 0019002 or, excluding leading zeros, just 19002. Given a positive integer N. Find the largest number of M such that it will, when added with its inverted, will give a fixed number N.

Input data

The first line contains one integer N (1 <= N <= 10^100^{ }^000).

Output data

Bring one number - the answer to the question of the problem. If the desired number does not exist, output a 0.

Examples

Input example #1
11
Output example #1
10
Author Pavel Kuznecov