yf={'A':1,'B':2,'C':3,'D':4} dj=map(str,raw_input().strip().split()); s=0 for x in dj: s=s+yf[x] print s