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