Task: Program Execution
Input (English): n, A, 8895, 2545, O, 2615, M, 2917, G, 783, 895, B, J
Output (English): 18650