Sum of primes
Submissions: 5924   Accuracy:

28.79%

  Difficulty: Basic   Marks: 1

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
Author: karanshrm44


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



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

to report an issue on this page.