Task: Program Execution
Input (English): 3199, G, f, 8949, X, 1825, R, g
Output (English): 13973