Two persons A and B invested in a business with 115000 and 75000 rupees respectively. They agree that 40% of the profit should be divided equally among them and rest is divided between them according to their investment. If A got 500 rupees more than B, then the total profit is