Hallie has $24 to spend on pencils. If each pencil costs $2 and she had $10 left, how many pencils did she buy? Written as a equation