Task: Program Execution
Input (English): 387, 1235, N, O
Output (English): 1622