Task: Program Execution
Input (English): M, 1243, V, 5803, W, 5705, 5753, r, m, T, 9753, g, H, 1607, K, 7897, N, 5169, 5381, r, 9331
Output (English): 11