Task: Program Execution
Input (English): K, q, 2387, X
Output (English): 1