Made Of
Time Limit: 0.5 sec
The Problem
You are given a string, which contains entirely of decimal digits (0-9). Each digit is made of a certain number of dashes, as shown in the image below. For instance 1 is made of 2 dashes, 8 is made of 7 dashes and so on.
You have to write a program that takes this string message as an input and returns a corresponding value in terms of a number. This number is the count of dashes in the string message.
0 consists of 6 dashes, 1 consists of 2 dashes, 2 consists of 5 dashes, 3 consists of 5 dashes, 4 consists of 4 dashes, 5 consists of 5 dashes, 6 consists of 6 dashes, 7 consists of 3 dashes [though the figure shows that 7 consists of 4 dashes but due to minor mistake in the problem please write your solution assuming 7 consists of 3 dashes], 8 consists of 7 dashes, 9 consists of 6 dash.
The Input
There are several lines of input . Each line consists a string message. String message will contain at least one digit, but not more than 100. Each character in message will be a digit ('0'-'9'). Input is terminated by EOF.
The Output
For each line of input you have to print the number of dashes in a separate line.
Sample Input
1213
12134
Sample Output
14
18
Online Practice Contest 3 [School & College Level]
Problem Setter: Parag Paul