Task: Program Execution
Input (English): 1671, 2977, A, T, 637, 3383, T, U, P, 7055, P
Output (English): 15723