Task: Program Execution
Input (English): X, q, 1291, 7179, 9
Output (English): 3