Manoj got Rs. 6000 as his share out of a total profit of Rs. 9000 which he and Ramesh earned at the end of one year. If Manoj invested Rs. 20000 for 6 months, whereas Ramesh invested his amount for the whole year, what was the amount invested by Ramesh?