Task: Program Execution
Input (English): 5, 10, ['o', 'M', '2609', 'o', '1765', 'G', 'a', 'N', '4351', '8603', '7673', '1813', '8061']
Output (English): 14719