BETA

Difficulty Level: Basic

Submissions: 2559 Accuracy:

32.04%

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 Input/Output Examples Use 'Expected Output' option **

Contributor: karan kumar

Set Default Code

					   
It is recommended to 'Compile & Test' your code before clicking 'Submit'!

Compilation/Execution Result:

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