231 divided by 12=19.25 - since 12 is the price he decided to charge you would dived the total amount he wants to earn (231) to get the amount of cars needed.
Or
231 divided by N- If he wants to charge more in order to need less cars, or to charge less and need more cars.