n = raw_input().strip().split() dict={'A':1,'B':2,'C':3,'D':4,'E':5} i=0 s=0 while i<len(n): s+=dict[n[i]] i=i+1 print s