Task: Program Execution
Input (English): M, 5591, 1983, 1971, 3803, 9971, 9389, 5221, 6015, 3117, m, H
Output (English): 9