Task: Program Execution
Input (English): 4401, 9469, N, 1913, M, 1147, v, h
Output (English): 4