Task: Program Execution
Input (English): Q, 1997, 2365, 1215, K, 5909, 2355, 7869
Output (English): 2