Task: Program Execution
Input (English): N, 3917, D, 2997, T
Output (English): 14, 3917, 4, 2997, 20