Task: Program Execution
Input (English): M, 2365, N, 8561, T, g, 3435, 2773, a
Output (English): 5