Express the amounts received by doctors and lawyers in terms of the amount received by teachers using the given conditions, then set the total distributed amount equal to the sum of amounts received by all individuals in each category.