Task: Program Execution
Input (English): q, Q, h, T, 9659, v, 9805, g, V, B, 4647, T
Output (English): 17, 17, 8, 20, 9659, 22, 9805, 7, 22, 2, 4647, 20