list=map(str,raw_input().split()) i=0 score=0 while i<5: if list[i]=="A":score=score+1 if list[i]=="B":score=score+2 if list[i]=="C":score=score+3 if list[i]=="D":score=score+4 i=i+1 print score