Task: Program Execution
Input (English): G, M, N, 447, 5541, z
Output (English): 7, 13, 14, 447, 5541, 26