Task: Program Execution
Input (English): 3931, 5471, m, X
Output (English): 2