Task: Program Execution
Input (English): T, 3561, q, 1885, r, 9309, 2009
Output (English): 3