A real estate aqent earns a commission on a house she sells. Her first commission is 5% on the first 500,000 of the sale price of the house. She then earns a 6% comission for the amount sbove 500,000 of the sale price of the house. How much commission did the agent earn if she sold the house for 585,000?