Let's solve the expression step by step:
First, simplify the expression inside the parentheses:
Calculate \( 24,717 \div 77 \): \[ 24,717 \div 77 \approx 321 \]
Now substitute that back into the expression: \[ 24,717 : 77 - 318 + 24 \approx 321 - 318 + 24 \]
Now perform the subtraction: \[ 321 - 318 = 3 \]
Now add 24: \[ 3 + 24 = 27 \]
Now, substituting this back into the original expression: \[ 5004 \times 27 \]
Finally, calculate \( 5004 \times 27 \): \[ 5004 \times 27 = 135108 \]
So, the final answer is: \[ \boxed{135108} \]