3. A merchant bought several bags of salt in Tver and sold them in Moscow with a profit of 100 rubles. With all the money earned, he again bought salt in Tver (at the Tver price) and sold it in Moscow (at the Moscow price). This time the profit was 120 rubles. How much money did he spend on the first purchase?
Solution. Let the merchant pay $x$ rubles for the salt during the first purchase in Tver. Then he sold it in Moscow for $x+100$ rubles. The second time, he spent $x+100$ rubles in Tver and received $x+100+120=x+220$ rubles in Moscow. Since the ratio of Moscow and Tver prices did not change, we can set up the proportion $\frac{x}{x+100}=\frac{x+100}{x+220}$, from which we get $x^{2}+220 x=x^{2}+200 x+10000, 20 x=10000, x=500$.

Answer: 500 rubles.