level = {'A': 1, 'B': 2, 'C': 3, 'D': 4} a = list(input().split()) s = 0 for l in a: s += level[l] print(s)