Sum

0

0 votes
Easy
Problem

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

Sample Input
2
333
686
Sample Output
9
0
Time Limit: 5
Memory Limit: 256
Source Limit:
Editor Image

?