Assume the total profit is \(x\) rupees. After donating \(5\%\), the remaining profit is \(\left(x - \cfrac{5x}{100}\right) = \cfrac{19x}{20}\) rupees. A and B's capital ratio is \(3:2\), So their respective shares in the profit are \(\cfrac{3}{5} : \cfrac{2}{5}\) [since \(3+2=5\)]. ∴ B’s share of the remaining profit = \(\cfrac{19x}{20} \times \cfrac{2}{5} = \cfrac{19x}{50}\) rupees According to the question: \(\cfrac{19x}{50} = 798\) So, \(x = \cfrac{798 \times 50}{19} = 2100\) ∴ The total profit is ₹2100.