Task: Program Execution
Input (English): 6687, M, X, m, 2521, 2943, 4433, 1351, x, 2379, 385, 1455, 2721, P, S, D
Output (English): 2, 3, 4, 9, 14, 15, 16