Task: Program Execution
Input (English): 2, 14, ['3351', 'A', 'X', 'X', '9397', '2345', '1475', '8865', 'p', '4921', 'D', '3777', '4427', '5615', 'N', '7621', '4173', 'o', '5309']
Output (English): 40822