ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

USU Championship 2007

About     Problems     Submit solution     Judge status     Standings
Contest is over

F. SMS-spam

Time limit: 1.0 second
Memory limit: 64 MB
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.
1
abc
2
def
3
ghi
4
jkl
5
mno
6
pqr
7
stu
8
vwx
9
yz
  0
.,!
#
_
The “_” 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 after all.

Input

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

Output a single number representing the cost of the given slogan, according to Petr's pricing.

Sample

inputoutput
pokupaite gvozdi tolko v kompanii gvozdederov i tovarischi!
114
Problem Author: Denis Musin
Problem Source: The XIIth USU Programing Championship, October 6, 2007
To submit the solution for this problem go to the Problem set: 1567. SMS-spam