level_value1={"A":1,"B":2,"C":3,"D":4} m=list(map(str,input().split())) s=0 for i in m: s+=level_value1[i] print (s)