Task: Program Execution
Input (English): q, 9571, P, R
Output (English): 2