David wants to buy packs of pencils for his classroom. He finds that when he buys packs of 5 pencils, he has 3 pencils left over. When he buys packs of 7 pencils, he has 4 pencils left over. When he buys packs of 11 pencils, he has 6 pencils left over. What is the smallest number of pencils David could have bought? Let's think step by step and output the final answer within \boxed{}.
user