Task: Program Execution
Input (English): 3051, 5343, k, k, 6815, E, 4745, A, A, 1251, 6649, f, 4133, X
Output (English): 31987