All for Nine and Nine for All

Everyone's favorite noontime show, Lunchtime Surprise, launched a new game recently. They called it: All for Nine and Nine for All. There would be boxes, each containing a single digit from 0 to 9, lined up and the team of nine contestants would have to decide which boxes to open. After opening the boxes, we can read the resulting number from left to right. If this number is positive and can be divided evenly by 9, then they either win that amount of money (in pesos) or 99999 pesos, whichever is lower. However, if the resulting number has leading zeros (e.g. reading the number from left to right results in 00144), it is considered an invalid number. Hence, the contetants lose in that case.

After a few episodes, they realized that winning was relatively easy. The researchers needed to revise the rules. In their proposed set of rules, contestants must choose a set of consecutive boxes instead of any set of boxes. All the other original rules apply.

Now, the researchers needed some kind of report that shows that there are less ways to win using their proposed rules, as compared to the original. They shall give examples of box arrangements and show how many ways one can win using the original set of rules, and how many ways to win using their proposed rules.

Input Format
The first line contains a single integer, which is . The second line contains a string of length , consisting of digits 0-9, describing a box arrangement.

Output Format
Output exactly two lines. The first line should contain an integer indicating the number of ways (modulo ) one can win using the original set of rules. The second line should contain an integer indicating the number of ways (modulo ) one can win using the proposed set of rules.

Constraints

Sample Input

5
33931

Sample Output

3
2

Explanation
For the original set of rules, there are three ways.

  1. The contestants can open boxes , and . Reading it from left to right, our contestants go home with 333 pesos!

  2. The contestants can open box only. Reading it from left to right, our contestants go home with 9 pesos!

  3. The contestants can open boxes , , and . Reading it from left to right, our contestants go home with 3393 pesos!

For the second method, there are two ways. These two ways are the cases illustrated as #2 and #3 above.

Line: 1 Col: 1
  1. Challenge Walkthrough
    Let's walk through this sample challenge and explore the features of the code editor.1 of 6
  2. Review the problem statement
    Each challenge has a problem statement that includes sample inputs and outputs. Some challenges include additional information to help you out.2 of 6
  3. Choose a language
    Select the language you wish to use to solve this challenge.3 of 6
  4. Enter your code
    Code your solution in our custom editor or code in your own environment and upload your solution as a file.4 of 6
  5. Test your code
    You can compile your code and test it for errors and accuracy before submitting.5 of 6
  6. Submit to see results
    When you're ready, submit your solution! Remember, you can go back and refine your code anytime.6 of 6
  1. Check your score