Task: Program Execution
Input (English): 3989, F, 8289, M, 6397
Output (English): 2