SP11575 EQ2 - A Famous Equation

Description

Mr. B wrote an addition equation such as 123+321=444 on the blackboard after class. Mr. G removes some of the digits and makes it look like “1?3+??1=44?”. After Mr. B realizes some digits are missing, he wants to recover them. Unfortunately, there may be more than one way to recover the equation. For example “1?3+??1=44?” can be recovered to “123+321=444” or “143+301=444” and many other possible solutions. Your job is to determine the number of different possible solutions.

Input Format

Each test case describes a single line with an equation like **a+b=c** which contains exactly one plus sign **+** and one equal sign **=** with some digits are missing and replaced with **?**. You may assume **a**, **b** and **c** are non-negative integers, and the length of each number is no more than 9. In the other words, the equation will contain three integers less than 1,000,000,000.

Output Format

For each test case, display a single line with its case number and the number of possible solutions to recover the equation.