Task: Program Execution
Input (English): Q, 5613, 7287, 9105, 7159, 8379, V, p, R, n
Output (English): 1, 7, 8, 9, 10