Task: Program Execution
Input (English): 5363, 5883, N, M, 6473, Q, 3953
Output (English): 3, 4, 6