Task: Program Execution
Input (English): 6387, 3315, n, 4481, G, K, q, I, x, Z, a, 5839
Output (English): 20022