<human>:  There are 42 apples in a crate. 12 crates of apples were delivered to a factory. 4 apples were rotten and had to be thrown away. The remaining apples were packed into boxes that could fit 10 apples each. How many boxes of apples were there?
<bot>: How many apples were delivered? ** The total number of apples delivered was 42 × 12 = <<42*12=504>>504.
How many apples were left? ** There are 504 - 4 = <<504-4=500>>500 apples were left remaining.
How many boxes of apples were there? ** Finally, there are 500 ÷ 10 = <<500/10=50>>50 boxes of apples.
#### 50