Ramanujan’s Prime Substrings
Ramanujan is so fond of playing number games. One day Ramanujan and Anish played a game. Ramanujan gave Anish a number string and asked him to find all the distinct substrings of size at most six that are prime. Anish being good at maths takes up the game and if he can give solutions to all the input sets Ramanujan provides him, Anish wins the game. Your task is to help Anish win the game.
Input Format
First line contains T, The number of test cases. Each test case contains a string of size N containing only integers.
Constraints
- 1 <= Number of Test Cases <= 10
- 1 <= N <= 10^7
Output Format
For Each Test case, print the total number of distinct prime substrings of length at most 6.
Sample Input 0
1
1333657
Sample Output 0
4
xxxxxxxxxx
1
with Ada.Text_IO, Ada.Integer_Text_IO;
2
use Ada;
3
4
procedure Solution is
5
-- Enter your code here. Read input from STDIN. Print output to STDOUT
6
7
8
end Solution