Task: Program Execution
Input (English): 7897, 2885, 6739, J, 2971, 4941, P
Output (English): 5