Evelyn works as a freelance graphic designer and earned $50,000 last year. She has to pay personal income tax on her earnings. Her tax is calculated as follows: the first $10,000 is taxed at 10%, the next $20,000 is taxed at 15%, and any amount over $30,000 is taxed at 20%. How much total tax does Evelyn need to pay? Let's think step by step and output the final answer within \boxed{}.
user