Seven Segments
You have recently bought a new microwave which has a -digit seven-segment display to tell the time in
-hour time. However, your new microwave is faulty, and sometimes segments which are supposed to be on are not. There are never any segments which should be off, but are on.
Given the current state of the display, how many unique possible times could it be displaying?
Input
Each test case will contain strings of length
which contain only '
' and '
', which represents the state of each digit of the display when read from left to right.
Below shows how each character maps to each segment. As an example, the string "" maps to the seven-segment display showing the number
.
Below is an image that shows all mappings of digits from to
.
Output
For each test case, print the number of unique times that could be displayed by adding any amount of segments (possibly none).
Example
Input
0000110
0000110
0001110
0101110
Output
84
The input represents the following display:
The following times are all the times that can be represented by adding in any amount of new segments:
00:00
00:08
00:09
00:30
00:38
00:39
01:00
..
18:39
19:00
19:08
19:09
19:30
19:38
19:39
Comments