Task: Program Execution
Input (English): 9707, Q
Output (English): 1