Task: Program Execution
Input (English): Q, 3167, 5241, 1277, M, 2989, 8277, 7311, 9787, 9647, 841, b
Output (English): 17, 3167, 5241, 1277, 13, 2989, 8277, 7311, 9787, 9647, 841, 2