This is a tricky problem,one that has to be solved using the dimensional analysis approach. To put it simply, manipulate the units until you get to the desired final unit that we are looking for, which is the number of freight cars. The solution is as follows:
(100 m³ sand/load)*(100 loads)*(1.5 tons/1m³ sand)*(1 freight car/40 tons) = 375 freight cars