Tickets to a school play cost $2 if bought in advance and $3 at the door. By selling all 400 tickets, $1030 was collected. First write, then solve the equation(s) to find out how many tickets were sold in advance.