David wants to buy a certain number of notebooks and pens. Each notebook costs $3 and each pen costs $2. If David has $50 and wants to buy 8 pens, how many notebooks can he afford? Let's think step by step and output the final answer within \boxed{}.
user