st=list(input().split()) tot=0 for i in range(0,5): if st[i]=="A": tot+=1 elif st[i]=="B": tot+=2 elif st[i]=="C": tot+=3 else: tot+=4 print(tot)