시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 512 MB 2 1 1 50.000%

문제

Peter is fond of number theory. That’s why he is looking for interesting bus tickets. Ticket with the number of length 2N is called interesting if the product of the first N digits of its number is equal to the product of the last N digits. Other tickets are called banal. Peter has found a used ticket in his pocket. Unfortunately the ticket was punched, so Peter cannot recognize some digits. He wonders whether this ticket was an interesting one. Moreover he wants to know how many different interesting and banal tickets could be punched to get this one. Help Peter to find answers to his questions.

입력

The first line of the input file contains an integer N (1 ≤ N ≤ 18). The next line contains a string representing the ticket number. If some digit is punched out it is denoted by “?” otherwise it is denoted by itself.

출력

On the first line of the output file print the number of interesting tickets. On the second line print the number of banal tickets.

예제 입력 1

2
2??3

예제 출력 1

4
96