list1=raw_input().strip().split() dict={'A':1,'B':2,'C':3,'D':4} s=0 for i in range(0,5): s=s+dict[list1[i]] print s