list1=map(str,raw_input().split()) y=0 for ss in list1: ss=ss.upper() if ss=="A": y=y+1 elif ss=="B": y=y+2 elif ss=="C": y=y+3 else: y=y+4 print y