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

### Instruction:
 Adam has 18 magnets. He gave away a third of the magnets, and he still had half as many magnets as Peter. How many magnets does Peter have?


### Response:
 Soit M le nombre d'aimants que Peter a.
Adam avait 18 aimants et en a donné 18/3 = <<18/3=6>>6.
Donc, Adam avait 18 - 6 = <<18-6=12>>12 aimants restants.
Peter a deux fois plus d'aimants qu'Adam, donc Peter a 2 * 12 = <<2*12=24>>24 aimants.