Hery is going to junior high school, and he meets a problem during his entrance examination: We define
f(x) as the sum of the number of cycles for each digit of x. More specifically, 1, 2, 3, 5, 7 have 0 cycle, 0,4, 6, 9 have 1 cycle and 8 has 2 cycles. For example:
f(81) = 2, f(88) = 4, f(0) = 1, f(1000) = 3
Please help hery calculate f(x).
输入描述:
The first line of input contains an integer
- the numbers of test cases in the input.For the next T lines ,each line contains a number
.
输出描述:
For each x,output the value of f(x).