Task: Program Execution
Input (English): R, I, 4609, 5035, Q
Output (English): 3, 4