eolymp
bolt
Try our new interface for solving problems
Problems

Vasyas tickets

Vasyas tickets

Time limit 1 second
Memory limit 64 MiB

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

Since the bus tickets in our time is a rarity, Vasya in search of the experimental material for the development of his theoretical research decided to produce a "revision" of his father's pockets, where he is quite a logical assumption, except for fish-hooks could accidentally be preserved and used tickets fishing trips. Unfortunately Vasya ticket was worn out and some of the figures he could not tell. But he really wants to know whether the ticket "interesting" to him, in fact, he wants to know how many different "interesting" and "normal" ticket could give them a ticket found.

Input data

The only line contains the ticket number. The figures that Vasya was not able to read the number indicated by the symbol "?". It is known that the ticket number is always an even number of digits and the number of digits, it can not exceed 18.

Output data

The first line of output file output the number of possible "interesting" ticket, and the second - the number of "normal" tickets.

Examples

Input example #1
2??3
Output example #1
4
96
Author Анатолий Присяжнюк
Source Open and Distance Olympiads 2011-2012