Task: Program Execution
Input (English): 1397, 8203, 4069, J, m, 8541, T, B, a, K, v, 8441
Output (English): 30651