Task: Program Execution
Input (English): d, q, 3153, 5831
Output (English): 2