Task: Program Execution
Input (English): 5217, 3463, 8001, 7571, 5735, K
Output (English): 29987