BETA

Submissions : 2301 Accuracy :

31.81

Sum of primes
       

Your task is to calculate sum  of primes present as digits of given number N.

Input:

The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The next T lines contains an integer N.

Output:
Print sum of primes in the digit

Constraints:

1 ≤ T ≤ 50
2 ≤ N ≤ 50000


Example:

Input:

2
333
686

Output:
9
0

**For More Examples Use Expected Output**


Contributor: karan kumar

Set Default Code

					   
Result:
It is recommended to test your code before clicking 'Submit' button!



                   



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.