Task: Program Execution
Input (English): N, 9187, 6483, 6707, 9873, X, 951, T, 9257, G, 4957
Output (English): 47415