Task: Program Execution
Input (English): 4, 10, ['S', '1997', 'x', '6973', '6961', '1341', 'S', 'a', 'P', 'F']
Output (English): 15275