Admission prices at a fair were $5 for children and $7 for adults. The total money collected was $3379 and 587 people attended the fair. How many children and how many adults attended the fair?