k=list(input().split()) score=0 for a in range(0,5): if k[a]=="A": score=score+1 if k[a]=="B": score=score+2 if k[a]=="C": score=score+3 if k[a]=="D": score=score+4 print(score)