Rates for having a manuscript typed at a certain typing service are $5 per page for the first time a page is typed and $3 per page each time a page is revised. If a certain manuscript has 100 pages, of which 40 were revised only once, 10 were revised twice, and the rest required no revisions, what was the total cost of having the manuscript typed?