Petr, a student, decided to start his own business. He offers SMS advertising
services to the business owners renting offices in the newly built “Prisma” tower.
If an office owner wants to use the service, he devises a slogan and Petr
texts it from his personal phone to thousands of Ekaterinburg citizens (he
already bought the pirated list of mobile phone numbers).
The cost of each slogan sent is a sum of costs of each character typed. Cost of
an individual character is determined according to a very simple scheme:
each tap at the phone's keyboard costs 1 rouble.
Petr's phone doesn't support sophisticated text input technologies, such as T9,
and only the english alphabet can be used.
_” character in the table denotes whitespace.
If you want to, for example, type “
a”, you need to press the “
1” button once.
To type “
k”, you press “
4” twice. To type “
!”, press “
0” three times.
Petr has to apply this simple algorithm to calculate the cost of every slogan he sends.
However, Petr is a very busy man (and, as a matter of fact, doesn't bother to learn arithmetics,
because he's a Philosophy student). You just have to help Petr, you are his best friend
The single line of input contains the slogan. Slogan consists of words,
spaces, commas, full stops and exclamation marks. All the words consist
of lowercase english letters. Slogan can't be longer than 1000 characters.
Output a single number representing the cost of the given slogan, according to Petr's pricing.
pokupaite gvozdi tolko v kompanii gvozdederov i tovarischi!
Problem Author: Denis Musin
Problem Source: The XIIth USU Programing Championship, October 6, 2007