The value of the letters P27152


Statement
 

pdf   zip

html

Your task is to write a program that computes the value of a given message. To compute it, we will consider that only the letters have value, and that each letter has greater value the more infrequent it is, as can be seen in this table:

||
ValorLetras
1a  e
2o  s
3d  i  n  r
4c  l  t  u
5m  p
6b  f  g  h  j  q  v  x  y  z
7k  w
||

Input

The input consists of a sequence of characters, which include exclusively lowercase letters, spaces and newlines.

Output

Your program must print the total value of the message, computed as the sum of the value of all its letters.

Public test cases
  • Input

    is a chinese wok
    

    Output

    42
    
  • Input

    i have seen things you people would not believe
    attack ships on fire off the shoulder of orion
    i watched c beams glitter in the dark
    near the tannhauser gate
    all those moments will be lost in time
    like tears in rain
    time to die
    

    Output

    590
    
  • Input

     
      hi  how 
     
        are
     you 
      
    

    Output

    41
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Carlos Molina
    Original language
    Spanish
    Other languages
    Spanish
    Official solutions
    C++
    User solutions
    C++