题目描述
Kancha wants to participate in a new event of Technobyte. Event says that you have to write a number in seven segment display using matchsticks. Please refer to the diagram below for how many sticks are used for each digit !!
Now, event coordinator gave kancha a long string. your task is to tell how many matchsticks will be used in writing that number as in the seven segment display !!
Input:
First line of input contains an integer t, then t lines follow each containing a number less than 10^5 digits !
Output:
Print one line containing the integer denoting the number of matchsticks used.
Constraints:
0<t ≤10
0 ≤ Input number ≤ 10^(10^5)
SAMPLE INPUT
1
13579
SAMPLE OUTPUT
21
Explanation
1 takes 2 sticks
3 takes 5 sticks
5 takes 5 sticks
7 takes 3 sticks
9 takes 6 sticks
Total = 21 sticks
输入格式
见题面
输出格式
见题面