Task: Program Execution
Input (English): k, D, 8949, G, B, N, V, 2813, 5339, 5397
Output (English): 22498