Task: Program Execution
Input (English): 2, 12, ['a', '5207', 'K', '1237', 'n', 'w', '2759', '943', '971', 'H', 'z', '6357', '463', '3991', 'M', '623', '8875', '1723']
Output (English): 17474