Adam gave away 18/3 = <<18/3=6>>6 magnets.
Adam had 18-6 = <<18-6=12>>12 magnets left.
Peter has 12*2 = <<12*2=24>>24 magnets.
#### 24