Below is an instruction that describes a task. Write a response that appropriately completes the request in Chinese. Please answer in Chinese.

### Instruction:
 艾米莉买了9包糖果项链，为了情人节给她的同学们。每包里有8条糖果项链。艾米莉一次只打开一包。在同学们拿走他们想要的糖果项链后，还剩下40条。艾米莉为她的同学们打开了多少包？


### Response:
 同学们拿走后剩下的糖果项链数 = 9包 * 8条糖果项链 - 40条糖果项链 = 40条糖果项链 - 72条糖果项链 = <<9*8-40=32>>32条糖果项链。
由于每包里有8条项链，这意味着还剩下32条糖果项链 / 8 = <<32/8=4>>4包糖果项链。