Task: Program Execution
Input (English): G, Z, 4819, 9763, 9987
Output (English): 24569