Task: Program Execution
Input (English): N, 7065, T, 5817
Output (English): 12882