Task: Program Execution
Input (English): n, Q, u, t, 9911, 7823, 9911, m, 7973, Q
Output (English): 4