A person invested 3 times as much money at 5% as he had invested at 2% per annum simple interest. Further he invested Rs. 6000 more at 3% than he had invested at 2%. If the total interest from the three investments after a year is Rs. 980, then the total amount he invested is: