Task: Program Execution
Input (English): Z, n, 5931
Output (English): 3