Task: Program Execution
Input (English): 2, 12, ['c', 'C', 'p', 'M', '7735', 'Z', '2097', 's', 'q', 'w', '7215', '1661', '9869', 'K', '1251', '7351']
Output (English): 18708