Task: Program Execution
Input (English): 345, 8289, N, 8169, R, 2647, h, s, x, 4713, b
Output (English): 345, 8289, 14, 8169, 18, 2647, 8, 19, 24, 4713, 2