Task: Program Execution
Input (English): 6947, 509, 1089, 9047, 5949, n, 7325, v, 1653, X, h, Q, 8143, 8605, r, p, W, 6021
Output (English): 10