The cakes cost 3*12=$<<3*12=36>>36
So he paid 36/2=$<<36/2=18>>18
#### 18