k = input().split() #print(k[1]) d={"A":1,"B":2,"C":3,"D":4} t=0 for i in range(0, len(k)): t+=d[k[i]] print(t)