Task: Program Execution
Input (English): T, t, N, 1233, 4347, Q, 1187, 6095, 6851, 2661, 4939, B, g
Output (English): 7