Emily bought 9 packs of candy necklaces * 8 candy necklaces in a pack = <<9*8=72>>72 candy necklaces.

Her classmates took 72 candy necklaces – 40 candy necklaces left = <<72-40=32>>32 candy necklaces

Since each pack contained 8 necklaces, this means 32 / 8 = <<32/8=4>>4 packs of candy necklaces were opened.

# Answer

4
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Emily bought 9 packs of candy necklaces to give her classmates at school for Valentine’s Day. Each pack had 8 candy necklaces in it. Emily opened one pack at a time. After her classmates took as many as they wanted, there were 40 candy necklaces left. How many packs did Emily open for her classmates?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
4
Emily bought 9 packs of candy necklaces to give her classmates at school for Valentine’s Day. Each pack had 8 candy necklaces in it. Emily opened one pack at a time. After her classmates took as many as they wanted, there were 40 candy necklaces left. How many packs did Emily open for her classmates?
train