A store sells pencils for $0.50 each and erasers for $0.75 each. If a student buys a total of 10 items consisting of only pencils and erasers, and spends a total of $6.25, how many pencils did the student buy?