It is given that the admission for a school play is $2.25 for children and $8.50 for adults.
Let x be the number of children and y be the number of adults that attended.
It is also given that 334 people attended the play so it follows:

It is also given that the total money collected from sales was $1814 so it follows:

Multiply the first equation by 2.25 to get:

Subtract (iii) from (ii) to get:

Substitute y=170 in (i) to get:

Hence, it follows:
Children attended 164
Adults attended 170