Task: Program Execution
Input (English): B, K, V, 5211, 7227, 2767, 4445, Z
Output (English): 19650