Task: Program Execution
Input (English): 9895, 2047, 31, d, 7179, 4703, 5513, Q
Output (English): 29368