P12921 [HackerEarth] seven segment display
普及
题目描述

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

输入格式

见题面

输出格式

见题面

样例输入
10 4523521178603692869044796170148349853679689223589819975621633677282235231443204731632537466129523854 1302325049960398304982582357280685122562102438321157305518841538649586388982800700181595650321563194 2512957332786830522308611150628493992503097661520589933615148557772011488860362819786574588314206955 2584012179530249068548473554084092626717113998377596528668340188273494382068218995173161310916753779 6142459609628574655695748727172794907427398429401178031179466176773614654381113774106098016090737760 2358321935091046096283633521548746905873724747546613484429689304391290357512901841761676799534817539 2076787661657785746646662708414451931557448461779663216603523146767518720596444338682182788418226703 5312120093644578761887756675998558181240106416173974696410892228871290343943796823484867097005701647 5226428168535467388982567116354536400626783544807257233251214438164020386618858650519202574296057479 0414697230479078861315093428512898696953414162392194906135553947193508245221646105614590229451295933
样例输出
489 512 500 485 458 483 476 485 498 485