Task: Program Execution
Input (English): n, m, 6211, 4329, 6981, 5875
Output (English): 23396