a man purchased 15 pens , 12 books , 10 pencils and 5 erasers . the cost of each pen is rs . 36 , each book is rs . 45 , each pencil is rs . 8 , and the cost of each eraser is rs . 40 less than the combined costs of pen and pencil . find the total amount spent ?