The sum of two numbers is 8, and the sum of their squares is 34. What is the smaller number?