X + R(X) = N
Ruslan is crazy about counting numbers and solving problems. His favourite pastime is to make up a problem and solve it by himself. Some time ago he heard about a very interesting problem: given the positive integer N, you have to say whether such X that X + R(X) = N exists or not, where X is a positive integer, and R(X) is the number X written backwards. Then, Ruslan has decided that this task is elementary, so he didn't start solving it, but made up a more difficult problem instead.
You are given the positive integer number N. How many positive integer numbers X are there, that X + R(X) = N?
R(X) is the number X written backwards. For example: .
Input
Input will consist of multiple test cases. Each case will be a single line containing number N (1 ≤ N ≤ 10^10000). A line with a single zero terminates the input.
Maximum size of input is 200000 bytes.
Output
Output for each test case should consist of a single integer on a line, indicating the number of numbers X satisfying the condition. Do not output leading zeros.