SP31974 ADAGIFT - Ada and Birthday

Description

Even though there is almost half a year before Ada the Ladybug's birthday, her friend already started searching for a birthday gift. As Ada is a mathematician, they decided to give her a number. They know that Ada loves numbers, which are composed by concatenation of prime numbers (at least one). Sometime there are multiple ways to do so: for example 37 can be concatenation of "3" and "7", yet it can also be concatenation of "37" itself. The more ways, the better the number is. Ada's friends want to surprise her by as good number as possible so they want you to write a program, which could count the number of ways. **NOTE:**Number with leading zeroes is a valid number (treat it as if the leading zeroes are not there)

Input Format

The first line contains an integer **1** Each of the next **N** lines contains a number **1**

Output Format

For each number, print the number of ways it can be written as concatenation of prime numbers.