A salesman’s commission is 5% on the first $10,000 in sales and 3% on the remaining amount in sales beyond the first $10,000. If the total sales were $50,000, find the commission earned by the salesman.