Task: Program Execution
Input (English): Q, 3161, 1961
Output (English): 2, 3