Task: Program Execution
Input (English): 1499, C, k, y, K, m, Q, 1341, k, A, 1403, 4141, n, q, M, K
Output (English): 8384