URI Online Judge | 1168

LED

Unknown Author
Timelimit: 1

John wants to set up a panel containing different numbers of LEDs. He does not have many leds, he is not sure if he will be able to mount the desired number. Considering the configuration of the LEDs of the numbers below, make an algorithm that helps John to discover the number of LEDs needed to set the value.


Input

The input contains an integer N, (1 ≤ N ≤ 2000) corresponding to the number of test cases, followed by N lines, each line containing a number (1 ≤ V ≤ 10100) corresponding to the value that John wants to set with the leds.

Output

For each test case, print one line containing the number of LEDs that John needs to set the desired value, followed by the word "leds".

Input Sample Output Sample

3
115380
2819311
23456

27 leds
29 leds
25 leds