Task: Program Execution
Input (English): 7913, 8521, 3717, Q, 3165, 5707, R, r, 3209, 7445, D
Output (English): 39677