Task: Program Execution
Input (English): 7371, 6239, 2473, 7447, 543, P, p, r, 5775, Q, 5931, 8659, 5065
Output (English): 6, 7, 8, 10