Your task is to calculate sum of primes present as digits of given number N.
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.
Print sum of primes in the digit
1 ≤ T ≤ 50
2 ≤ N ≤ 50000