Vasyas tickets#2069

Vasyas tickets

1 second
64 megabytes
Hard

Vasya had heard that there are so-called lucky tickets, for which the sum of the first digits equals the sum of the last digits. Deciding to make a contribution to the theory of numbers, Vasya called a ticket with a number of length interesting if the product of the first digits of this number is equal to the product of the last digits. All other tickets Vasya called normal.

Since bus tickets are nowadays a rarity, in search of experimental material for his theoretical research, Vasya decided to inspect his father's pockets, where, by his quite logical assumption, in addition to fishhooks, used tickets from fishing trips could have been accidentally preserved. Unfortunately for Vasya, the ticket was worn out and some of the digits could not be read. But he really wants to know whether this ticket could be interesting for him. Moreover, he wants to know how many different interesting and normal tickets could correspond to the ticket he found.

Input

The only line contains the ticket number. Digits that Vasya could not read are indicated by the symbol ?. It is known that the ticket number always consists of an even number of digits, and the number of digits does not exceed .

Output

Print the number of possible interesting tickets on the first line, and the number of normal tickets on the second line.

Examples

Example 1

Loading
Loading