Task: Program Execution
Input (English): 2, 7, ['S', '9413', 'M', 'B', 'N', '6839', '1593', 'O', '3457']
Output (English): 17845