Task: Program Execution
Input (English): 4, 4, ['3499', '9979', '5119', '8419', 'N', '2089', '2675', 'R', '5901', '3337', '741', '8347', 'd', 'a', '9557', '2327', '1645', '793']
Output (English): 9148