Problem: Solve the mystery

HINT : Digital Display
Input :
First line has an integer T.
Next T lines has an integer N in each line. It is guaranteed that N never starts with 0 unless value is equal to zero.

Output :
Print the output for each test case in new line.

Constraints :
1 ≤ T ≤ 1000
0 ≤ |N| ≤ 1000
|N| is number of digits.

Problem Setter : Vinay Kumar

SAMPLE INPUT
8
1234567
123456
1234
193
12
11
1
0

SAMPLE OUTPUT
30
27
16
13
7
4
2
6

Solution (in PYTHON):

Solution:
t=input()
n=[ '' for x in range(100)]
for x in range(t):
	n=raw_input('')
	count=0
	for a in xrange(0,len(n)):
		if n[a]=='1':
			count=count+2
		elif n[a]=='2':
			count=count+5
		elif n[a]=='3':
			count=count+5
		elif n[a]=='4':
			count=count+4
		elif n[a]=='5':
			count=count+5
		elif n[a]=='6':
			count=count+6
		elif n[a]=='7':
			count=count+3
		elif n[a]=='8':
			count=count+7
		elif n[a]=='9':
			count=count+6
		elif n[a]=='0':
			count=count+6
	print count