A trader buys some bags of wheat from a farmer at a rate of $20 per bag. If it costs $2 to transport each bag from the farm to the warehouse, and the trader made a total profit of $400 after selling all the bags at a rate of $30 each, how many bags did he sell?
Each bag of wheat cost the trader $20+$2=$<<20+2=22>>22 (taking transportation costs into account)
Each bag of wheat was sold for $30 each giving a profit of $30-$22=$<<30-22=8>>8 on each bag
Since a total of $400 profit was made, the total number of bags sold is $400/$8=<<400/8=50>>50 bags
#### 50