Task: Program Execution
Input (English): 4817, 393, 8169, M, D, 907
Output (English): 2