Task: Program Execution
Input (English): 1, 12, ['r', '1295', 'J', 'K', '613', 'b', '4383', 'c', '3487', '5727', '6485', '2987']
Output (English): 24977