
# excercise 3  convert input string to its value

# I use two constant strings to store
#   the character and its corresponding value

str = "ABCDEFGH"
val = "12345678"

#  for c in str   is used to extract each character

inp = input().strip()
sum = 0

#  sum is used to accumulate the value

for c in inp:

#  then get the index of c and use that index
#  to get its value (convert to integer)

    i = str.find(c)
    v = int(val[i])
    sum += v

print(sum)

# this is the common trick used since early days
# of computer programming.  String can be used
# to store information

